home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 015a / dosimp10.zip / SIMPLY6.HYP < prev    next >
Text File  |  1991-08-12  |  112KB  |  1,957 lines

  1.                          Input/Output |tRedirection|t
  2.                          
  3. Hey, this is a really useful subject!  Well, to redirect something means
  4. to take something that was supposed to come from or go to a certain place
  5. and take it from or send it to a different place instead.  STanDard INput
  6. (called STDIN for short) usually comes from the keyboard, so input redir-
  7. ection means to make the input come from somewhere else instead.  STan-
  8. Dard OUTput (also called STDOUT) usually goes to the monitor, so output
  9. |nredirection|n means to make the output go to somewhere else instead.  Pret-
  10. ty simple concept, huh?
  11.  
  12. For input |nredirection|n, the symbol is <.  For example, suppose you want to
  13. delete a whole directory full of files, from within a batch file.  If the
  14. |nbatch file|n gives the command |nDEL|n C:\TEMP\*.* then the DEL command's going
  15. to ask "Are you sure? (Y/N)" and sit there waiting for Y or N input from
  16. the |nkeyboard|n.  Well if you know that the answer to that question is def-
  17. initely going to always be Y, then you can create a little file on your
  18. disk that contains nothing but a Y and carriage return (the <Enter> key),
  19. and name that file Y.TXT, and make the STDIN for that question come from
  20.                            <page down> for more
  21.                            Redirection continued
  22. that file instead of from the keyboard, and then the batch file can con-
  23. tinue on its merry way without your having to press a Y or N key, like
  24. this:
  25.           |nDEL|n C:\TEMP\*.* < Y.TXT
  26.  
  27. Of course the DEL part has to come first, because that's the name of the
  28. command, so in order to get Y.TXT pointing toward the command, use the <
  29. symbol.  Now when the |nDEL|n command tells DOS that it wants some STDIN from
  30. the |nkeyboard|n, DOS is going to give the input from the Y.TXT file instead,
  31. because the |nDEL|n command won't know the difference as long as it gets some
  32. input.
  33.  
  34. Another time that input |nredirection|n is really useful, is with the MORE
  35. command.  This command takes STDIN and sends it to STDOUT 23 lines at a
  36. time.  That doesn't do much good at all unless STDIN is redirected from
  37. somewhere else besides the |nkeyboard|n.  You can read a long text file one
  38. page at a time, with this command:
  39.           |nMORE|n < FILENAME.EXT
  40.                            <page down> for more
  41.                            Redirection continued
  42. Notice that the < symbol causes the file to be pointing toward the MORE
  43. command.  If you were to accidentally type the > symbol instead the |nMORE|n
  44. command would send STDOUT to the file, instead of taking STDIN from the
  45. file, and that would effectively erase every byte of data from that file.
  46. Make sure the symbol points from the file toward the command!
  47.  
  48. Now make sure you understand that once you redirect STDIN from somewhere
  49. toward a command, that command is not going to accept any input from the
  50. keyboard, because it's taking all of its input from the place you redir-
  51. ected it from.  If a command takes some input and then does something and
  52. then asks for some more input, that second piece of input has got to be
  53. in the same place that the first piece was in, or else the command will
  54. sit there all day waiting for the second piece of input to come from that
  55. same place.  The command won't pay the slightest bit of attention to the
  56. |nkeyboard|n, because you told it to take its input from somewhere else.  So
  57. make sure that if you write a little file like Y.TXT for a purpose that
  58. requires more than one piece of input, that you put all the input that
  59. will be needed for the entire command, into that file.
  60.                            <page down> for more
  61.                            Redirection continued
  62. For example, the FORMAT command asks you first to place the disk into the
  63. drive and press <Enter>, and then it starts formatting.  So suppose you
  64. were to make a file that contained just a carriage return, and you used
  65. the command |nFORMAT|n A: < CR.TXT to redirect that file into the |nFORMAT|n com-
  66. mand.  Well it will start out working just fine, but when the formatting
  67. is done |nFORMAT|n is going to ask you "Format another? (Y/N)" and it's going
  68. to sit there forever waiting for the Y or N to come from that CR.TXT file
  69. and the only thing you can do about it is reboot the computer.  Run the
  70. command a few times first, to make sure you know exactly what input the
  71. command is going to want, before you create a file to redirect into it!
  72. (The DOS version 5 |nFORMAT|n command is not a good candidate for input re-
  73. direction, because under different circumstances it will ask for differ-
  74. ent input.  For example, if a disk doesn't have enough free space on it
  75. for the |nMIRROR|n.FIL file, then |nFORMAT|n will ask if you want to format it
  76. anyway, even though it won't be |sUNFORMAT|stable, so your little text file
  77. won't be able to deal with that question if it comes up!)  It won't mat-
  78. ter if the text file being redirected into a command has too much data in
  79. it, as long as all the data the command is going to need is there and in
  80.                            <page down> for more
  81.                            Redirection continued
  82. the right order.  You can put fifty extra characters into the file if you
  83. want, and nobody will care, as long as they come after the parts that the
  84. command is going to want.
  85.  
  86. The MORE command requests the data that it is to display, from the STDIN
  87. device, so if the STDIN has been redirected from somewhere other than the
  88. the keyboard, then that's where |nMORE|n will take its input from.  But for
  89. the keystroke that tells |nMORE|n to display the next screenful, |nMORE|n doesn't
  90. request that particular piece of input from STDIN, it looks right at the
  91. |nkeyboard|n instead, for that piece of input.  So that's why you can still
  92. "press any key to continue" even though STDIN has been redirected.  But
  93. for any command that takes all of its input from STDIN, then in that case
  94. the |nkeyboard|n will be totally ignored when input is redirected, until that
  95. particular command completes and exits back to DOS.
  96.  
  97. Another use for input |nredirection|n is when you've temporarily disabled CON
  98. (that's the name for the CONsole device which means monitor-and-|nkeyboard|n)
  99. with the CTTY command, and you need to take just one little piece of in-
  100.                            <page down> for more
  101.                            Redirection continued
  102. put from the keyboard.  For example, PAUSE < |nCON|n so that you will be able
  103. to use the |nkeyboard|n to "Press a key when ready . . ."
  104.  
  105. Output |nredirection|n is even more useful!  You can take all the stuff that
  106. a command usually sends to STDOUT, and send it to a file, or to a print-
  107. er, or to your modem, or even to a place called NUL which means nowhere.
  108. Now this will not effect STDERR, which means the place where a command
  109. sends ERRor messages to.  Those will still go to the monitor, even when
  110. STDOUT is redirected elsewhere.  But little messages like "1 File(s) cop-
  111. ied" can be sent to |nNUL|n so you don't have to look at them on the screen.
  112. The output of the MEM command can be sent to a printer so you can take it
  113. over to your friend's house, and show him how much free memory you have
  114. now that you installed DOS version 5.  The entire output of the CHKDSK
  115. command can be sent to a disk file so that you can look at it later.  But
  116. you have to watch it with that one, though, because that does mean the
  117. entire output.  If |nCHKDSK|n runs into any errors on your disk, it will send
  118. the message about "Convert lost chains to files? (Y/N)" to the disk file
  119. where you won't be able to see it.  You won't even realize that |nCHKDSK|n is
  120.                            <page down> for more
  121.                            Redirection continued
  122. sitting there waiting for you to answer the question.  You can say Y or N
  123. or you can say <Ctrl-C> to break out of the CHKDSK command, but it will
  124. take you a minute to realize that you need to do such a thing.  Of course
  125. you'd better use the <Ctrl-C> method though, because you don't know what
  126. question |nCHKDSK|n is waiting for an answer to.  Well here are the commands
  127. you would use to perform those tricks:
  128.           |nCOPY|n FILENAME.EXT D: > |nNUL|n
  129.           |nMEM|n /C > |nPRN|n
  130.           |nCHKDSK|n C:*.* /V > FILENAME.EXT
  131.  
  132. See, the little arrow points in the direction in which you want the flow
  133. to occur.  We're sending output away from the command and toward the file
  134. or toward the device|1s, so we're using the > symbol.
  135.  
  136. Make sure you understand that if the recipient of the > symbol is a file-
  137. name, and there already exists a file by that name, whatever that file
  138. contains is going to be irrevocably lost the second you hit the <Enter>
  139. key to execute that command.  Because whenever DOS sees an output redir-
  140.                            <page down> for more
  141.                            Redirection continued
  142. ection symbol, the very first thing that happens is that DOS opens the
  143. file that's referred to in the command, and dumps the contents of that
  144. file into the "bit-bucket".  (That's just an expression that basically
  145. means trash can.  Remember, a bit is an eighth of a byte, which is the
  146. amount of data taken up by one character.)  Whenever the > symbol points
  147. toward a filename, the file is created if it doesn't exist already, or if
  148. it does exist, it is erased.  Wiped out.  Immediately.  Before DOS even
  149. looks at the rest of what you typed on that command line.  Also, if there
  150. doesn't end up being any STDOUT directed toward that file, the file will
  151. still exist because DOS created it as soon as you hit the <Enter> key.
  152. For example, if you typed |nDEL|n FILENAME.EXT > TEST, then the file named
  153. TEST will be created even though there is no output from a command like
  154. |nDEL|n FILENAME.EXT.  TEST will just be a zero-length file, but it will have
  155. a directory entry even though it won't take up any disk space.
  156.  
  157. If a file already exists and you want to add some more data to it, you
  158. can use a double >> sign, like this:
  159.           |nMEM|n /C >> MEMCHKS.TXT
  160.                            <page down> for more
  161.                            Redirection continued
  162. Whenever DOS sees a double >> sign, that means to create the file if it
  163. doesn't already exist, or add more data to the end of the file if it does
  164. already exist, which is called appending the data to the file.
  165.  
  166. Now all these |nredirection|n examples so far have involved one command and
  167. one device or filename.  What if you want to redirect one command to an-
  168. other?  That's what the third type of |nredirection|n is for.  It's called
  169. piping and it uses the pipe symbol which looks like ||.  That's the char-
  170. acter on top of the \ key, so if you hold down a <Shift> key and type \
  171. you'll get || and that's a pipe.  Piping takes the output from the first
  172. command on the command line, and sends it as input to the second command
  173. on the command line.  For example,
  174.           |nCHKDSK|n C:\*.* /V || |nMORE|n
  175. That takes the output of the CHKDSK command that would normally be sent
  176. to your screen at about a million miles per minute, and sends it instead
  177. as input to the MORE command.  The |nMORE|n command takes its input and div-
  178. ides it into 23-line sections, and sends each section to the screen with
  179. a "-- More --" symbol at the bottom, which means you should press a key
  180.                            <page down> for more
  181.                            Redirection continued
  182. when you're ready to see the next screenful of output.
  183.  
  184. Remember, you can't use pipes with filenames or device|1s, only commands.
  185. Piping sends STDOUT from one command as STDIN to another command.  And
  186. you can't put a command to the right of a > or < symbol.  The only thing
  187. that goes to the right of those symbols is a device or filename.
  188.  
  189. Here's another useful example.  Remember how you can use a command like
  190. |nDEL|n C:\TEMP\*.* < Y.TXT to make the DEL command work without waiting for
  191. you to say whether you're "sure" or not?  Well that requires that you
  192. have a little file named Y.TXT which contains a Y and a carriage return,
  193. sitting on your disk taking up an entire cluster of disk space.  This
  194. command will serve the same purpose, without that Y.TXT file:
  195.           |nECHO|n Y || |nDEL|n C:\TEMP\*.*
  196. The output of this ECHO command is a Y and carriage return, so with the
  197. pipe, that gets sent to the |nDEL|n command whenever |nDEL|n gets ready to ask
  198. for its input.  Now you can get rid of your Y.TXT file that's taking up
  199. all that disk space!
  200.                            <page down> for more
  201.                            Redirection continued
  202. The only problem with piping is that DOS needs to borrow some disk space
  203. to create some temporary files, whenever you use piping.  If your current
  204. disk doesn't have enough room, or if you're on a network and you don't
  205. have write access to the |ncurrent|n drive, or if you have a write-protect on
  206. the |ncurrent|n disk, then DOS won't be able to perform the piping operation.
  207. Also, if you should use the <Ctrl-C> keystroke to break out of the com-
  208. mand, or if you have a power outage in the middle of the command, then
  209. those little temp files will get left on your disk, for you to wonder
  210. later where they came from.
  211.  
  212. If you have DOS version 5, you can set an environment variable named TEMP
  213. which will tell DOS where you want those temp files created, instead of
  214. in older versions of DOS, the temp files were created in the |ncurrent|n dir-
  215. ectory of the |ncurrent|n drive.  No more!  If you have a RAMdisk with E: for
  216. a drive letter, put these commands into your AUTOEXEC.BAT file:
  217.           MKDIR E:\TEMP
  218.           |nSET|n TEMP=E:\TEMP
  219. Now whenever DOS does any piping, it will put those temp files onto the
  220.                            <page down> for more
  221.                            Redirection continued
  222. RAMdisk.  That's great for two reasons.  First, a |nRAMdisk|n is so much fas-
  223. ter than any other type of disk, so piping operations will be faster than
  224. they would be if TEMP was not set or if it was set to a slow hard disk.
  225. Second, if you have a power failure in the middle of the command, you
  226. won't have to go and erase those little temp files because when the |npower|n
  227. went out, everything on the |nRAMdisk|n, including the little temp files, was
  228. erased automatically.
  229.  
  230. Even if you don't have a |nRAMdisk|n, if you have DOS version 5 you should
  231. use a |nSET|n TEMP=C:\SOMEWHERE command in your AUTOEXEC.BAT file, so that
  232. your temp files all end up in the same place, instead of being scattered
  233. all over the place depending on what drive and directory you happened to
  234. be in at the time you performed a piping operation.  Of course, if the
  235. operation is completed properly, DOS will delete the temp files all by
  236. itself.
  237.  
  238. You can also combine more than one |nredirection|n character in the same com-
  239. mand.  For example:
  240.                            <page down> for more
  241.                            Redirection continued
  242.           |nFIND|n "Hello" FILE1 || |nSORT|n /+3 || |nMORE|n
  243.           |nCHKDSK|n C:\*.* /V || |nFIND|n "WHAT" > |nPRN|n
  244.           |nFORMAT|n A: < FMT.TXT > DISKSIZE.TXT
  245. But except for the pipe symbol, you can't use more than one of the same
  246. symbol in the same command.  For example,
  247.           |nDIR|n > FILE1 > FILE2
  248. will not send the output of the DIR command to both of those files!
  249.  
  250. There is a type of command called a "filter", which takes STDIN from the
  251. keyboard and performs some function on it, and then sends STDOUT to the
  252. screen.  Filters don't really do anything useful unless they're used with
  253. some |nredirection|n.  FIND, MORE, and SORT are the filters that come with
  254. DOS, although the |nFIND|n filter is easier to use as a regular command in-
  255. stead of as a normal filter.  That means, use it without the < symbol.
  256.  
  257. You can also use |nredirection|n to create an empty file or a non-empty file.
  258. Remember that as soon as DOS sees the > symbol, if there's a filename on
  259. the other side of that symbol then the specified file gets created, be-
  260.                            <page down> for more
  261.                            Redirection continued
  262. fore DOS even looks at the rest of the command.  So if you do not have a
  263. file named FILE1 and you execute this command:
  264.          |nTYPE|n FILE1 > FILE1
  265. then DOS creates a file named FILE1 and so far it's empty, but it does
  266. exist.  So then DOS types out the contents of the FILE1 file (nothing),
  267. and sends that output (nothing) to the FILE1 file.  So FILE1 still con-
  268. tains nothing.  You just created a zero-length file which takes up a
  269. directory entry, but no disk space gets used because the file is empty.
  270.  
  271. You can use the ECHO command to create a non-empty file like this:
  272.           |nECHO|n HELLO > FILE2
  273.           |nECHO|n HOW ARE YOU >> FILE2
  274. DOS creates a file named FILE2 and the |nECHO|n command puts the word HELLO
  275. and a carriage return into that file.  The next command opens the FILE2
  276. file again, and sends the words HOW ARE YOU and another carriage return,
  277. to the end of the file.
  278.  
  279. If you're absolutely positive that the last line in your CONFIG.SYS file
  280.                            <page down> for more
  281.                            Redirection continued
  282. ended with a carriage return, then you can add a new line to the end of
  283. it without even editing it.  Like this:
  284.           |nECHO|n DEVICE=C:\DOS\ANSI.|nSYS|n >> C:\CONFIG.|nSYS|n
  285. But if the last line in the CONFIG.SYS file were STACKS=0,0 and that com-
  286. mand didn't have any carriage return at the end of it, then the result of
  287. that ECHO command would be this:
  288.           STACKS=0,0DEVICE=C:\DOS\ANSI.|nSYS|n
  289. all on one line like that, and DOS wouldn't appreciate that command very
  290. well the next time you reboot the computer and DOS tries to execute the
  291. commands in your |nCONFIG.SYS|n file.  That's a good reason to make sure that
  292. each command in your |nCONFIG.SYS|n file, or any batch file, ends with a car-
  293. riage return (the <Enter> key).
  294.  
  295. You can use input |nredirection|n to make script files for commands such as
  296. EDLIN and DEBUG.  If you upgraded from DOS version 3.2 to 3.3, and wanted
  297. to change the first line of each |nbatch file|n from |nECHO|n OFF to @ECHO OFF,
  298. you could create a little text file named |nEDLIN|n.TXT like this:
  299.  
  300.                            <page down> for more
  301.                            Redirection continued
  302.           1
  303.           @ECHO OFF
  304.           E
  305. and then use this command:
  306.           |nFOR|n %a IN (*.BAT) DO |nEDLIN|n %a < |nEDLIN|n.TXT
  307. And automatically, right before your very eyes, all your batch files will
  308. be updated to include the @ symbol which didn't appear in DOS until ver-
  309. sion 3.3.  Here's how it works.  The FOR command causes DOS to repeat the
  310. command that's written after DO, for each file that matches the specifi-
  311. cation in parentheses.  So for each .BAT file in the current directory,
  312. DOS will perform the command |nEDLIN|n WHATEVER.BAT < |nEDLIN|n.TXT.  That will
  313. load the EDLIN line editor and the WHATEVER.BAT file, and then instead of
  314. taking STDIN from the keyboard, |nEDLIN|n will take its input from the file
  315. you created named |nEDLIN|n.TXT, which contains all the commands |nEDLIN|n needs
  316. to change line one of the file to @ECHO OFF, and then save the changed
  317. file to disk, and exit back to DOS.  Then DOS will continue on with the
  318. |nFOR|n command, with the next .BAT file in the |ncurrent|n |ndirectory|n, until they
  319. have all been edited.  From now on, whenever you run your batch files,
  320.                            <page down> for more
  321.                            Redirection continued
  322. you won't see that ugly old "|nECHO|n OFF" command flash onto the screen, be-
  323. cause what the @ symbol does is it tells DOS not to display the command.
  324. That's just about the best thing about EDLIN, even though it's a really
  325. primitive text editor, is that it will take redirected input from a text
  326. file script like that.
  327.  
  328. Now if you want the script file to cause |nEDLIN|n to insert any lines, you
  329. have to remember that |nEDLIN|n requires a <Ctrl-C> keystroke to go from in-
  330. sert mode back to the command mode.  So the <Ctrl-C> must be part of the
  331. script file.  It's not easy to get a <Ctrl-C> into a file, but it can be
  332. done.  With |nEDLIN|n itself.  You use the <Ctrl-V> keystroke sequence in ED-
  333. LIN to tell |nEDLIN|n that the next keystroke you enter should be interpret-
  334. ed as a control character.  So <Ctrl-V> followed by a capital C will put
  335. the <Ctrl-C> into the file.  It will look like this:
  336.           1I
  337.           |nECHO|n OFF
  338.           ^VC
  339.           E
  340.                            <page down> for more
  341.                            Redirection continued
  342. That script, if redirected as input into an EDLIN command, would insert
  343. the command |nECHO|n OFF before the first line of the file you're EDLINing.
  344. (Remember that ^C or ^V means the same thing as <Ctrl-C> or <Ctrl-V>.)
  345. The next time you look at or edit that script file, the V will be miss-
  346. ing, but that's ok.  It was only there in order to tell |nEDLIN|n to put the
  347. ^C into the file, and it served its purpose.  You can't just type <Ctrl-
  348. C> to get it in the file, because if you type <Ctrl-C> in |nEDLIN|n, it swit-
  349. ches from insert mode to command mode.  |nEDLIN|n can't tell you were trying
  350. to put the ^C into the text rather than trying to switch to command mode.
  351. So that's why you needed the <Ctrl-V> trick.
  352.  
  353. Don't forget that if you have DOS version 5 and have /P as part of your
  354. DIRCMD environment variable, then if you should use the command:
  355.           |nDIR|n > FILE1
  356. to put your directory listing into a text file, DOS will be performing
  357. the command |nDIR|n /P because of your DIRCMD setting, and it will be sit-
  358. ting there waiting for you to "Press any key . . ." only you won't real-
  359. ize it because the "Press any key . . ." message has been redirected into
  360.                            <page down> for more
  361.                            Redirection continued
  362. the FILE1 file along with the rest of STDOUT, and you'll think you've
  363. locked up the computer when all you need to do is press any key.  Then
  364. redo that command like this:
  365.           |nDIR|n /-P > FILE1
  366. to make DOS ignore the /P in the DIRCMD variable this time.
  367.  
  368. You can't redirect the input or output of a batch file, although you can
  369. use |nredirection|n on each line in a |nbatch file|n.  For example, to make all
  370. output of a |nbatch file|n go to the NUL device instead of to your screen,
  371. you might be tempted to try this:
  372.           BATCH > |nNUL|n
  373. Nope, it won't work!  BATCH.BAT will be executed as usual, and all the
  374. STDOUT will go to the screen.  If you want to suppress the output of the
  375. |nbatch file|n, you need to put a > |nNUL|n at the end of each line in the batch
  376. file.  |nRedirection|n on the command line that executes the |nbatch file|n won't
  377. work, even though |nredirection|n will work just fine inside the |nbatch file|n.
  378.  
  379. All DOS commands send their output to either STDOUT or STDERR.  STDERR is
  380.                            <page down> for more
  381.                            Redirection continued
  382. always the monitor, and STDOUT is the monitor unless |nredirection|n has been
  383. specified.  But lots of programs that don't come with DOS send their out-
  384. put straight to video memory, and for those programs, trying to redirect
  385. output from the screen to somewhere else just won't work!  And lots of
  386. programs take their input straight from the keyboard rather than from
  387. STDIN, so for those programs, input |nredirection|n won't work.  Sorry!
  388.  
  389. And remember that when you're using piping, the command to the right of
  390. the pipe symbol is still a plain old regular DOS command, so just like
  391. always, its executable file must be either in the current directory, or
  392. on the PATH, in order for the command to work.
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.                              The |TSUBST|T Command
  402.  
  403. This is a command that's kind of dangerous (although it's certainly safer
  404. than |sASSIGN|s), but it does have its uses if you follow the rules.
  405.  
  406. It is used to make a directory pretend like it is a drive.  For example:
  407.           |nSUBST|n G: C:\WORD\DOCS\LTRS\JOHN
  408. After you enter that command you can reference the C:\WORD\DOCS\LTRS\JOHN
  409. |ndirectory|n by simply typing G:.
  410.  
  411. Of course for that command to work you have to use the LASTDRIVE command
  412. in your CONFIG.SYS file to tell DOS you'll be needing a G: drive.  If the
  413. highest drive letter you already have is D:, then you want to say some-
  414. thing like |nSUBST|n E: C:\WORD\DOCS\LTRS\JOHN instead of using G:, and then
  415. you'll only need to say LASTDRIVE=E, instead of G, in |nCONFIG.SYS|n.
  416.  
  417. To cancel a SUBSTitution and put things back to normal, |nSUBST|n G: /D or
  418. |nSUBST|n E: /D will do it.  To display a list of SUBSTitutions you have in
  419. effect, type |nSUBST|n all by itself, with no parameters.
  420.                            <page down> for more
  421.                               SUBST continued
  422. There are a bunch of commands that are unsafe for use with any |nSUBST|n in
  423. effect:  ASSIGN, BACKUP, CHKDSK, DEL, DISKCOMP, DISKCOPY, ERASE, FDISK,
  424. FORMAT, LABEL, JOIN, MIRROR, RECOVER, RESTORE, and SYS.
  425.  
  426. So why would anybody want to use a command that gives problems with so
  427. many other DOS commands?  Well there are quite a few times when this is
  428. useful.  For one thing, if you find that your PATH environment variable
  429. is too long, and you don't have time right now to reorganize your entire
  430. hard drive or write |sbatch file|ss so you can shorten it, you can do |nSUBST|n
  431. E: C:\WORD and |nSUBST|n F: C:\UTIL and replace C:\WORD with E:\ and C:\UTIL
  432. with F:\ on your |nPATH|n command in your AUTOEXEC.BAT file, and that saves
  433. you 8 characters.  But that is not a permanent solution to the 127-char-
  434. acter limit for the |nPATH|n variable!  Use batch files or DOSKEY |nmacros|n in-
  435. stead of a long |nPATH|n.
  436.  
  437. What if you have an application such as an old version of WordStar, that
  438. doesn't know anything about pathnames and stuff?  You can trick WordStar
  439. into using subdirectories by saying |nSUBST|n E: C:\WORD\DOCS and then tell-
  440.                            <page down> for more
  441.                               SUBST continued
  442. ing WordStar to pull up a file from your E: drive.
  443.  
  444. And then there's always the reason of just plain laziness.  It's a lot
  445. easier to type E: than it is to type C:\WORD\DOCS\LTRS\JOHN.  But in my
  446. opinion that is nowhere near a good enough reason to use such a danger-
  447. ous command!
  448.  
  449. You can also do something like this:
  450.           |nSUBST|n A: C:\TEMP
  451. for programs that insist on using drive A: when you want them to use your
  452. hard drive.  After you issue that command, whenever the program requests
  453. something from drive A:, DOS will give it something from the TEMP direc-
  454. tory of drive C: instead.
  455.  
  456. Or for programs that want drive A:, and you made the mistake of buying
  457. the program on the wrong size disks, and you can only use them in your
  458. B: drive, and the program won't work because it wants drive A:, and oh
  459. my, what are you going to do?  Try |nSUBST|n A: B:\ and see if it works.
  460.                            <page down> for more
  461.                               SUBST continued
  462. Of course you can't use your A: drive while one of these commands is in
  463. effect, because whenever you tell DOS something about A:, it will think
  464. you're talking about C:\TEMP or B:\ or whatever is SUBSTituted for A:.
  465.  
  466. Now if you have some application that requires you to use the |nSUBST|n com-
  467. mand because that app doesn't understand about subdirectories, then you
  468. want to only run that app from a batch file that makes the SUBSTitution,
  469. runs the program, and then cancels the SUBSTitution between the time you
  470. exit the app and the time you get your DOS prompt back.  That way, you
  471. don't have to worry about those commands that |nSUBST|n is not compatible
  472. with.
  473.  
  474.  
  475.  
  476.  
  477.  
  478.  
  479.  
  480.  
  481.                                The |tKeyboard|t
  482.  
  483. Well, you know what the |nkeyboard|n is, so why am I writing a chapter about
  484. it?  Well there are quite a few things you might not know about it, even
  485. though all its keys are labeled.
  486.  
  487. First, the most important thing that's not written on the |nkeyboard|n, is
  488. that you can BREAK out of many programs by holding down the <Ctrl> key
  489. while pressing the <C> or <Break> keys.  (The <Break> key is up there
  490. near the <PrtScrn> key, usually on the same physical key with <Pause>.
  491. If you're not pressing <Ctrl> when you hit that key, it means <Pause>,
  492. or if you are pressing <Ctrl>, then that key means <Break>.)  This key-
  493. stroke combination can be abbreviated as <Ctrl-C> or <Ctrl-Break>, and
  494. if you want to get out of nearly any DOS command, and many other com-
  495. mands too, this keystroke will usually take you straight back to a DOS
  496. prompt.  There is a difference between <Ctrl-C> and <Ctrl-Break> though.
  497. If you've already entered some keystrokes that haven't been processed
  498. yet, that is, if you're typing faster than the computer is computing,
  499. the unprocessed keystrokes are still sitting in the |nkeyboard|n buffer.
  500.                            <page down> for more
  501.                             Keyboard continued
  502. Well, the <Ctrl-C> keystroke will sit there at the end of the buffer,
  503. just like any other keystroke, waiting for its turn to be processed.
  504. But <Ctrl-Break> will cut in front of everybody else in line.  So it
  505. will work sometimes when <Ctrl-C> won't.
  506.  
  507. If your computer is spitting out a bunch of data onto the screen a lot
  508. faster than you can read it, you can stop it with the <Pause> key if you
  509. have one, or else the <Ctrl-S> combination.  Press any other key to make
  510. the screen start going again.  (Sometimes you have to use <Ctrl-Q> to
  511. make it start going again after using <Ctrl-S>.)
  512.  
  513. <Ctrl-Z> or <F6> will give you a symbol that looks like ^Z which is the
  514. End-of-File character.  (The caret (^) symbol means <Ctrl>).  If you are
  515. using the COPY CON command, or the SORT command without any redirection
  516. of input, then ^Z is what tells DOS you're done entering data from the
  517. |nkeyboard|n as far as that specific |nCOPY|n |nCON|n or |nSORT|n operation is concerned.
  518.  
  519. The <Esc> key, at the DOS command line, will cancel what you were typing
  520.                            <page down> for more
  521.                             Keyboard continued
  522. and move the cursor down one line so that you can start over on the com-
  523. mand you were getting ready to enter.
  524.  
  525. In a lot of programs, you can enter ASCII symbols that aren't on the key-
  526. board, by holding down the <Alt> key, and typing the |nASCII|n code on the
  527. numeric keypad, and then letting up on the <Alt> key.  For example, if
  528. you use this method to type <Alt-20>, you get the  character.  A really
  529. interesting use for this fact is with |nASCII|n character 255.  It's called a
  530. blank.  It looks like a <Space>, but it's not.  It's an actual character,
  531. and it's even valid in filenames.  So you can use it as a primitive sort
  532. of security.  You never want to use it in the middle of a filename, be-
  533. cause everybody knows that a <Space> is not a legal filename character,
  534. so anyone who sees a filename like MY STUFF.TXT is going to realize right
  535. away that it's an <Alt-255> instead of a <Space> in there.  But since DOS
  536. displays filenames in DIR listings in two columns, with spaces between, a
  537. filename like MYSTUFF<Alt-255>.TXT will look like "MYSTUFF  TXT" and any-
  538. one who's not really familiar with the <Alt-255> trick won't realize that
  539. filename is anything other than MYSTUFF.TXT.  Well there's still another
  540.                            <page down> for more
  541.                             Keyboard continued
  542. problem with this.  If you have DOS 5 and a body used the /B or /W swit-
  543. ches with the DIR command, that filename will look like "MYSTUFF .TXT"
  544. and once again, anyone who knows about <Alt-255> will figure it out right
  545. away.  The same thing would happen with the output of the CHKDSK command
  546. with the /V switch.  But, if you don't give the filename an extension,
  547. then MYSTUFF<Alt-255> will look exactly like MYSTUFF in any sort of dir-
  548. ectory listing.  This is good for directory names, too.  You could name
  549. a |ndirectory|n PCT<Alt-255><Alt-255><Alt-255>, and even someone who knows
  550. about the <Alt-255> trick won't be all that likely to try three of them
  551. in a row like that.  Well this method of protection is good if all the
  552. other people who use your computer are really beginners, who don't know
  553. about <Alt-255>, but it's still a pain to live with it.  Because you have
  554. to type the <Alt-255> part of the filename or |ndirectory|n name, every time
  555. you want to access it.  You even have to include the <Alt-255> in the
  556. name, on your PATH command in AUTOEXEC.BAT if you want that |ndirectory|n to
  557. be on the |npath|n.
  558.  
  559. If you have a numeric keypad, then you have a <NumLock> key to control
  560.                            <page down> for more
  561.                             Keyboard continued
  562. it.  If <NumLock> is on, then the numeric keypad will type numbers.  If
  563. it is off, the arrows and other functions on the numeric keypad will be
  564. activated.  Most newer computers will boot up with the <NumLock> key on
  565. automatically, but there are tons of little public domain utilities that
  566. you can use as commands in your AUTOEXEC.BAT file, to turn it back off
  567. again.  The same goes for the <CapsLock> key, if you want to always |nboot|n
  568. up with it on.
  569.  
  570. <ScrollLock> has practically no use.  For software programs that use it,
  571. it works this way:  with the key set one way, when you use the arrow keys
  572. to scroll through a file, the cursor will stay right on the same place on
  573. the screen, changing lines as the lines go by.  With the <ScrollLock> key
  574. set the other way, when you scroll through the file, the cursor will move
  575. on the screen, staying on the same line of text, or until that line gets
  576. to the edge of the screen, anyway.
  577.  
  578. The <PrtScrn> key, or on some computers, the <Shift-PrtScrn> combination,
  579. will cause the computer to send a copy of whatever's on your screen to
  580.                            <page down> for more
  581.                             Keyboard continued
  582. the PRN device.  If the |nPRN|n device is not connected, is not turned on, or
  583. is not online, your whole system could just hang until the printer times
  584. out.  If trying to print a graphics screen causes your printer to flip
  585. out, then try the GRAPHICS command first.
  586.  
  587. The <Ctrl-Alt-Del> keystroke combination will reboot your computer.
  588.  
  589. The <F1> through <F10> Function keys have different functions according
  590. to what software program you're running at the moment, but when you're in
  591. DOS, they have their own functions.  (See editing keys.)  You can also
  592. program them to do whatever you want them to do, with ANSI.SYS.  (See al-
  593. so macros.)
  594.  
  595. The <F11> and <F12> Function keys don't do anything, as far as most soft-
  596. ware programs are concerned.
  597.  
  598. The <Enter> key has lots of names.  <Return> and <Carriage Return> and
  599. <CR> are just a couple.  Some keyboards have just an arrow like ─┘ on
  600.                            <page down> for more
  601.                             Keyboard continued
  602. that key instead of a word.  It's the one over on the right of the alpha-
  603. bet keys, between the Right <Shift> and the <Backspace> keys, and it is
  604. nearly the most important key you have.  It's what tells DOS you're done
  605. typing a command, and that you want DOS to execute that command now.
  606.  
  607. <Ctrl-P> will toggle printer echoing.  That means it will cause the prin-
  608. ter to start printing everything that appears on your screen.  To make it
  609. stop doing that, press <Ctrl-P> again.
  610.  
  611. A lot of books will tell you to find a key that looks like │ in order to
  612. perform an operation called piping, which is a form of redirection.  Well
  613. the key you're looking for looks like || instead of │, but the books just
  614. can't print a || character I guess.  The || character is the <Shift> ver-
  615. sion of the backslash (\), and its location depends on the |nkeyboard|n you
  616. use.  It's one of those keys that move around from brand to brand of key-
  617. board.  Most keys are in the same place no matter what kind of |nkeyboard|n,
  618. but not that one.  On the three keyboards I've used extensively, that key
  619. has been located in three different places.  Once near the <Backspace>,
  620. once below the <Enter>, and once in the lower lefthand corner.  Sheesh!
  621.                              Numbering Systems
  622.  
  623. You don't have to know this stuff if you don't want to.  Well it is pret-
  624. ty important but not learning it is not going to make your computer use-
  625. less or anything.
  626.  
  627. The |tdecimal|t numbering system is the one you've been using all your life.
  628. It uses ten (10) as its base number.  (There are ten symbols in our num-
  629. bering system:  0, 1, 2, 3, 4, 5, 6, 7, 8, and 9.)  That means that in a
  630. multi-digit number, the rightmost digit tells how many multiples of 10-
  631. to-the-0th-power are in the number.  (N^0=1)  The first digit from the
  632. right tells how many multiples of 10-to-the-1st-power are in the number.
  633. (N^1=N)  The second digit from the right tells how many multiples of 10-
  634. to-the-2nd-power are in the number.  (N^2=NxN)  The third digit from the
  635. right tells how many multiples of 10-to-the-3rd-power are in the number.
  636. (N^3=NxNxN)  Et cetera.  (In math, the symbol ^N means to-the-Nth-power.)
  637.  
  638. All right, suppose we have a number in the |ndecimal|n system that looks like
  639. 589,236.  Well, what does that number mean?
  640.                            <page down> for more
  641.                   Decimal, Binary, Hexadecimal continued
  642.           5     4     3     2     1     0---how many digits from right
  643.           5     8     9     2     3     6---the digits in the number
  644.                                         6x10^0=6x1=6
  645.                                   3x10^1=3x10=30
  646.                             2x10^2=2x100=200
  647.                       9x10^3=9x1000=9000
  648.                 8x10^4=8x10000=80000
  649.           5x10^5=5x100000=500000
  650. Now, add up the totals from each line, and you've got 589,236.  That's
  651. right, that's just the number we started with.  That's because we just
  652. converted a |ndecimal|n number right back to a |ndecimal|n value.
  653.  
  654. But computers can't deal with the |ndecimal|n system.  A computer can only
  655. distinguish between two things.  Either a particular circuit has |npower|n
  656. running through it, or it doesn't.  Either on or off.  One or zero.  So
  657. computers use the |tbinary|t numbering system.  |nBinary|n means two, so the bi-
  658. nary system has only two different digits.  Zero, and one.  That's all
  659. there is.  There is no 2, no 3, no 4, nothing but 0 and 1.  What kind of
  660.                            <page down> for more
  661.                   Decimal, Binary, Hexadecimal continued
  662. numbers can you make with only two possible symbols?  Any numbers you can
  663. make with ten symbols.  It just takes more digits to do it.
  664.  
  665. So, suppose we have a |nbinary|n number like 10110101101.  What does it mean?
  666.           10   9   8   7   6   5   4   3   2   1   0
  667.            1   0   1   1   0   1   0   1   1   0   1
  668.                                                    1x2^0=1x1=1
  669.                                                0x2^1=0x2=0
  670.                                             1x2^2=1x4=4
  671.                                        1x2^3=1x8=8
  672.                                    0x2^4=0x16=0
  673.                                1x2^5=1x32=32
  674.                            0x2^6=0x64=0
  675.                        1x2^7=1x128=128
  676.                    1x2^8=1x256=256
  677.                0x2^9=0x512=0
  678.            1x2^10=1x1024=1024
  679.  
  680.                            <page down> for more
  681.                   Decimal, Binary, Hexadecimal continued
  682. Now, add up the totals from each line, and you've got 1453.  You've just
  683. converted a number from |nbinary|n to |ndecimal|n!  Aren't you proud?
  684.  
  685. Now we're going to convert that |ndecimal|n number back to |nbinary|n!  Aren't
  686. you excited about that prospect?  Here goes.  Well, we know that 1453 is
  687. larger than 2^10.  But is it larger than 2^11?  Well 2^11=2048, so no,
  688. our |nbinary|n number won't need an eleventh digit.  (It will have eleven
  689. digits, but the first one is the zeroth digit, so the eleventh one is
  690. digit number ten.  Clear as mud, right?)  All right, we know that we're
  691. going to need a 1 in the tenth digit, because our number is larger than
  692. 2^10 which is 1024.  So, subtract 1024 from our number, and we have 429
  693. left.  Well, do we need a one in the ninth digit?  2^9=512, and 429 is
  694. less than that, so no, we won't need a number in the ninth digit.  Fill
  695. it up with a zero.  What about the eighth digit?  2^8=256, and 429 is
  696. larger than that, so we need a one in the eighth digit.  429-256=173 so
  697. that's the next number we're going to work with.  Do we need a one in the
  698. seventh digit?  2^7=128, and 173 is larger than that so we do need a one
  699. in the seventh digit.  173-128=45.  2^6=64, so we don't need a one in the
  700.                            <page down> for more
  701.                   Decimal, Binary, Hexadecimal continued
  702. sixth digit.  Fill that space with a zero.  2^5=32 and 45 is larger than
  703. that, so we need a one in the fifth digit.  45-32=13 and 2^4=16, so the
  704. fourth digit gets a zero.  2^3=8 and 13 is larger than that so the third
  705. digit gets a one.  13-8=5 and 2^2=4 so the second digit gets a one.  5-4
  706. =1 and 2^1=2 so the first digit from the right gets a zero, and 2^0 is 1
  707. and 1 is what we had left, so the rightmost digit gets a 1.  So, here's
  708. what we've got:  10110101101  Yep, that's just what we started with!
  709.  
  710. Ok, now to the |thexadecimal|t system of numbering.  Hex means six and deci-
  711. mal means ten so |nhexadecimal|n means sixteen.  That's the base number of
  712. this system, just like ten is the base in the |ndecimal|n system and two is
  713. the base in the |nbinary|n system.  There are sixteen symbols in the hex sys-
  714. tem:  0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F.  We use this
  715. system with computers a lot because it's a lot closer to |nbinary|n than dec-
  716. imal is, since sixteen is two to the fourth |npower|n and ten is not an even
  717. |npower|n of two at all.  But yet, hex is definitely closer to |ndecimal|n too,
  718. since you don't have to use eleven digits just to represent the number
  719. 1453 like you do in |nbinary|n.
  720.                            <page down> for more
  721.                   Decimal, Binary, Hexadecimal continued
  722. So, if we have a hex number like 3FA8C, what does it mean?
  723.           4     3     2     1     0--how many digits from right
  724.           3     F     A     8     C--the digits in the number
  725.           3    15    10     8    12--|ndecimal|n representation of hex symbol
  726.                                  12x16^0=12x1=12
  727.                             8x16^1=8x16=128
  728.                      10x16^2=10x256=2560
  729.                15x16^3=15x4096=61440
  730.           3x16^4=3x65536=196608
  731. All right, add up those totals from each line, and you've got 260748.
  732. That's what 3FA8C hex is, in |ndecimal|n.  Want to convert 260748 back to
  733. hex?  I knew you did.  Ok, let's go.
  734.  
  735. Well 16^5=1048576 and 260748 is much less than that, so we will not need
  736. a fifth digit at all.  16^4=65536 and 260748 is larger than that so we
  737. will need a fourth digit, but what number should go in that digit?  Div-
  738. ide 260748 by 65536, and you see that we need a 3 in that digit.  What's
  739. left over after we subtract 3x65536 from 260748?  64140.  Well, 16^3=4096
  740.                            <page down> for more
  741.                   Decimal, Binary, Hexadecimal continued
  742. and 64140 is way bigger than that, so we won't want a zero in the third
  743. digit, but what do we want to put there?  Divide 64140 by 4096, and we
  744. get a 15 which is an F in hex.  Now, subtract 15x4096 from 64140, and our
  745. remainder is 2700.  16^2=256 and 2700 is lots bigger than that.  Do your
  746. division, and 10 |ndecimal|n or A hex goes in the second digit, with 140 left
  747. over.  16^1=16 and 140 is bigger than that.  Divide.  The first digit is
  748. 8 with 12 left over, and 12 in hex is C so that's the zeroth digit.  Put
  749. it all together and you've got 3FA8C.  Yep, that's what we had to begin
  750. with, so the conversion worked perfectly.  Whew!
  751.  
  752. If you don't understand how it is that we're doing this |ndecimal|n-to-what-
  753. ever conversion stuff, maybe it would help if we tried using the same
  754. method to convert a |ndecimal|n number to |ndecimal|n?  Let's try it, with the
  755. number 857203.  Well 10^6=1000000 and 857203 isn't that big, so we won't
  756. need any number in the sixth digit.  10^5=100000 and 857203 is bigger
  757. than that so what number do we need in the fifth digit?  Divide 857203
  758. by 100000 and you get 8.  So subtract 8x100000 from 857203 and you have
  759. 57203 left.  10^4=10000 and 57203 is larger than that, and if you divide
  760.                            <page down> for more
  761.                   Decimal, Binary, Hexadecimal continued
  762. 57203 by 10000 you get a 5 for the fourth digit, and if you subtract 5x
  763. 10000 from 57203 you have 7203 left.  Well 10^3=1000 and 7203 is larger
  764. than that, so if you divide 7203 by 1000 you get 7 so that's the third
  765. digit, and if you subtract 7x1000 from 7203 you get 203.  Well 10^2=100
  766. and if you divide 203 by 100 you get a 2 for the second digit, with 3
  767. left over.  10^1=10 and 3 is not that big so a zero goes in the first
  768. digit from the leftmost one.  10^0=1 and 3 is 3 times that, so a 3 goes
  769. in the zeroth digit.  Put them all together, and you've got 857203.
  770.  
  771. Ok, should we do the octal system of numbers next?  Well octal means 8
  772. so the octal system has eight digits.  0, 1, 2, 3, 4, 5, 6, and 7.  I'll
  773. leave the rest of it up to you if you're interested.  It works just the
  774. same way as the other systems.
  775.  
  776. Just one more thing.  If you ever need to convert an eight-digit |nbinary|n
  777. number to hex, or convert a two-digit hex number to |nbinary|n, there's a
  778. very easy way to do it.  First, each digit in a |nbinary|n number is a bit.
  779. Eight |nBInary|n digiTS (bits) is a byte.  Four |nbinary|n digits, half a byte,
  780.                            <page down> for more
  781.                   Decimal, Binary, Hexadecimal continued
  782. is a nibble, believe it or not.  Well if you have a |nbinary|n number like
  783. 10110011, first divide that into two nibbles.  The leftmost nibble is
  784. 1011 and the rightmost nibble is 0011.  Now, all you have to do to con-
  785. vert that whole byte to hex, is to convert the left nibble to hex and
  786. convert the right nibble to hex, and stick those two numbers together.
  787.           1011                                 0011
  788.              1x2^0=1x1=1                          1x2^0=1x1=1
  789.             1x2^1=1x2=2                          1x2^1=1x2=2
  790.            0x2^2=0x4=0                          0x2^2=0x4=0
  791.           1x2^3=1x8=8                          0x2^3=0x8=0
  792.          total=11 |ndecimal|n=B hex               total=3 |ndecimal|n=3 hex
  793. So, 10110011 in |nbinary|n equals B3 in |nhexadecimal|n.  To convert a two-digit
  794. hex number to |nbinary|n, just do the opposite.  Convert the left digit to
  795. |ndecimal|n and then |nbinary|n, and convert the right digit to |ndecimal|n and then
  796. |nbinary|n and stick the righthand |nbinary|n number up against the right of the
  797. lefthand |nbinary|n number, and there you go.
  798.  
  799. So, did you notice anything familiar in that section on |nbinary|n numbers?
  800.                            <page down> for more
  801.                   Decimal, Binary, Hexadecimal continued
  802. Did the numbers 64, 128, 256, 512, or especially 1024 ring a bell?  Have
  803. you ever wondered why a kilobyte is equal to such a silly number as 1024
  804. bytes, instead of 1000 |nbytes|n?  That's because computers do things in bi-
  805. nary, not |ndecimal|n.  The number 1000 in |ndecimal|n, is 1111101000 in |nbinary|n.
  806. We don't want to make the computer try to work with a number like that,
  807. do we?  While two to the tenth |npower|n is 1024 in |ndecimal|n, in |nbinary|n it's
  808. 10000000000 and that's a nice easy round number for the computer.
  809.  
  810. Those other numbers I mentioned are going to end up being very familiar
  811. to you as well if you pay any attention at all to what your computer does
  812. with memory and disk space and stuff.  512 is 2^9, 256 is 2^8, 128 is
  813. 2^7, and 64 is 2^6 and they are very common numbers when talking about
  814. |nmemory|n.  As far as the computer is concerned, they are the round numbers
  815. 1000000000, 100000000, 10000000, and 1000000 and it's only because they
  816. have been translated into |ndecimal|n that they seem to be random values.
  817.  
  818. When you see something like 10h or 10H that means the number 10 in hex-
  819. adecimal, which is 16 in |ndecimal|n.  Some books will even say 10d or 10D,
  820. to avoid ambiguity even when they're talking about |ndecimal|n numbers.
  821.                          What Are |tLogical Drives|t?
  822.  
  823. Well, a logical drive is one that doesn't really exist physically, but
  824. that DOS thinks exists.  For example, a RAMdisk.  That's just a chunk of
  825. memory that DOS has been told to treat like a disk.  It has a drive let-
  826. ter, like D: or E:, and you can copy files to it, or read files from it,
  827. but you can't open up the computer's case and put your hand on it.  Be-
  828. cause it's a section of |nmemory|n.  So it's not a physical drive, but it is
  829. a logical drive because DOS treats it like a drive.
  830.  
  831. If you have a very large hard drive and you have it partitioned into more
  832. than one section (that was probably done with |sFDISK|s), each with its own
  833. drive letter, DOS treats those partitions as if they were totally separ-
  834. ate drives, even though they're all right there on the one physical hard
  835. drive.  Those are |nlogical drives|n too.
  836.  
  837. If you have used the SUBST command to tell DOS that you are going to pre-
  838. tend that your C:\WORD\DOCS directory is really drive F:, then that's a
  839. logical drive too.  You can't open up your computer's case and find any
  840.                            <page down> for more
  841.                          Logical Drives continued
  842. drive F: that's separate from any of your other physical drives, and yet
  843. DOS will let you refer to the files in C:\WORD\DOCS by just using the
  844. letter F:.
  845.  
  846. What if you have a computer with only one floppy drive, drive A:?  How
  847. could you possibly copy files from one |nfloppy|n disk to another?  If you
  848. tried the command |nCOPY|n A:FILENAME.EXT A:, hoping that DOS would tell you
  849. to put a different disk in the drive to accept the copy, well sorry, but
  850. that's not going to happen.  DOS is going to say "File cannot be copied
  851. onto itself".  What can you do?  Easy.  |nCOPY|n A:FILENAME.EXT B: will do
  852. it.  But you don't have a drive B:, you say?  Sure you do.  Not a phys-
  853. ical one, but a logical one.  Whenever you only have one |nfloppy|n drive DOS
  854. automatically gives you a logical drive B: which is sort of a ghost twin
  855. to drive A:.  So you can do lots of operations that require two drives,
  856. and DOS will just tell you at the appropriate moment, whether to put in
  857. the disk for drive A: or the one for drive B:.  You put them in the exact
  858. same place, but DOS keeps track of which is which.
  859.  
  860.                            <page down> for more
  861.                          Logical Drives continued
  862. Well if you do have a physical drive B:, you can still convince DOS to
  863. give you |nlogical drives|n to go with your floppy drives like that.  With a
  864. device driver called |TDRIVER.SYS|T.  You load this contraption into your
  865. CONFIG.SYS file with a DEVIC|1E command, and DOS will set up the logical
  866. drives, and assign the drive letters according to whatever drives you
  867. already have.  Suppose you have a hard drive partitioned into logical
  868. drives C: and D:, and you have a RAMdisk E:, and you put the |nDRIVER.SYS|n
  869. in after the line that loads the |nRAMdisk|n, then the first logical drive
  870. you set up with |nDRIVER.SYS|n will be F:, the next one will be G:, etc.
  871.  
  872. Don't ever forget, DOS assigns logical drive letters to |nlogical drives|n on
  873. a first come, first served basis.  Every time you boot up, DOS looks to
  874. see how many hard drive partitions you have, and gives them each a letter
  875. starting with C:.  Supposing your hard drive has only one partition, then
  876. D: is the next letter available by the time DOS executes the commands in
  877. the |nCONFIG.SYS|n file, so the first |nDEVICE|n command in |nCONFIG.SYS|n that tries
  878. to set up a logical drive, will get the letter D:.  Then the next request
  879. for a logical drive from |nCONFIG.SYS|n will get letter E: and so forth until
  880.                            <page down> for more
  881.                          Logical Drives continued
  882. CONFIG.SYS is finished.  You can't control the order in which DOS assigns
  883. drive letters to physical drives, because it will always be in alphabet-
  884. ical order, but by changing the order of the statements in |nCONFIG.SYS|n you
  885. can control which |nlogical drives|n will get what drive letters.
  886.  
  887. Now if you were already using some SUBST commands in your AUTOEXEC.BAT
  888. file perhaps, for drive letters F: and G:, you'll have to change them to
  889. H: and I: if you create |nlogical drives|n in the |nCONFIG.SYS|n file that re-
  890. ceive drive letters F: and G:.  Because the letters F: and G: are now
  891. going to refer to your floppy drives, so you don't want to use them for
  892. |nSUBST|n commands.  Also, any batch file that is going to reference those
  893. SUBSTituted drives, you have to change those references to H: and I: as
  894. well.  Setting up |nlogical drives|n with DRIVER.SYS can affect any logical
  895. drives that you had set up with RAMdisks or |nSUBST|n commands, so watch what
  896. your batch files say!  If you add or remove any |nlogical drives|n, that will
  897. change the drive letters that your other |nlogical drives|n are going to re-
  898. ceive, but your batch files are still referring to the same drive letters
  899. as before, which now are assigned to different |nlogical drives|n, and that's
  900.                            <page down> for more
  901.                          Logical Drives continued
  902. going to be a real mess unless you update each batch file with the new
  903. drive letter assignments.
  904.  
  905. If you use your RAMdisk all the time, and plan to keep DRIVER.SYS in your
  906. CONFIG.SYS file only sometimes then put the |nDRIVER.SYS|n line or lines af-
  907. ter the |nRAMdisk|n line.  That way, whether you're using the |nDRIVER.SYS|n or
  908. not, your |nRAMdisk|n keeps its same drive letter all the time.  If you put
  909. the |nDRIVER.SYS|n before the |nRAMdisk|n, then your |nRAMdisk|n's drive letter would
  910. be always changing depending on whether you have the |nDRIVER.SYS|n installed
  911. today or not.  If you plan to use |nDRIVER.SYS|n all the time and |nRAMdisk|n on-
  912. ly sometimes, then do it the other way around.  Put the |nRAMdisk|n after the
  913. |nDRIVER.SYS|n, so your "ghost twin" floppies always keep their same drive
  914. letters, whether or not you are using a |nRAMdisk|n today.  If you do change
  915. the order of the logical-drive-creating commands in |nCONFIG.SYS|n, you have
  916. to remember to change every |nbatch file|n you have that references a logical
  917. drive letter.
  918.  
  919. Even more important, whether you're using SUBST or not, or using a |nRAM|n-
  920.                            <page down> for more
  921.                          Logical Drives continued
  922. disk or not, any time you create |nlogical drives|n in any way, DOS needs to
  923. be warned that you are going to be using them.  If you're ever going to
  924. end up with a drive F: or a drive J:, you have to have a LASTDRIVE com-
  925. mand in your CONFIG.SYS file to tell DOS how many |nlogical drives|n you're
  926. going to be using.
  927.  
  928. Now suppose you do have those drives set up the way I mentioned, so that
  929. when DOS gets to the DRIVER.SYS line in |nCONFIG.SYS|n the letters F: and G:
  930. are the next available ones, DOS will assign F: to the first |nDRIVER.SYS|n
  931. statement you have, and if you have another one too, it will get G:, and
  932. the next one will get H:, and so forth.  If the first one was set up to
  933. match your A: drive then you can do something like |nCOPY|n A:FILENAME.EXT F:
  934. just like a person without a B: drive can do |nCOPY|n A:FILENAME.EXT B:.  DOS
  935. will tell you when to take out the A: disk and put the F: disk into the
  936. same physical drive.  Now you can copy files from one 3.5" disk to anoth-
  937. er even if you only have one physical disk drive of that size.  Before
  938. |nDRIVER.SYS|n, you could only do that with the DISKCOPY command.
  939.  
  940.                            <page down> for more
  941.                          Logical Drives continued
  942. Know what else you can do with DRIVER.SYS?  If your physical drive A: is,
  943. for example, a high density 5.25" drive, you can set up a logical ghost
  944. twin for it that is a double density 5.25" drive, and then you can say
  945. |nFORMAT|n F: instead of remembering to say |nFORMAT|n A: /F:360 and the disk'll
  946. get formatted to double density even though it's physically being done in
  947. a high density drive.  If you tell DOS that F: is a 360K drive, then DOS
  948. will use the 360K FORMAT when you specify drive F:.  (Of course that will
  949. not work the other way around.  If you have a double density drive, you
  950. can't make DOS pretend that it's a high density drive.  A double density
  951. drive just doesn't have the right hardware to read or write high density
  952. disks, no way, no how.)
  953.  
  954. If you did that, making a double density logical drive twin for your high
  955. density physical drive, you can still use high density |ndisks|n in that dou-
  956. ble density logical drive!  It's only double density for formatting pur-
  957. poses.  It's still physically a high density drive, so it can still read
  958. and write high density |ndisks|n.
  959.  
  960.                            <page down> for more
  961.                          Logical Drives continued
  962. If you wanted to, you could even give the exact same DEVICE=DRIVER.|nSYS|n
  963. command twice in a row, making two extra |nlogical drives|n for one physical
  964. drive.  That could be useful for if you have a third floppy drive, which
  965. needs a DRIVER.SYS driver to even work, and then the second |nDRIVER.SYS|n
  966. line, for that drive, would set up a logical drive twin for it, so that
  967. you could copy between disks in that drive.
  968.  
  969. All right, how do you use |nDRIVER.SYS|n?  Well it's not too hard.  Here's
  970. the syntax:
  971.           DEVICE=D:\DIR\DRIVER.|nSYS|n /D:# /T:## /S:## /F:#
  972. where D: is the drive where the |nDRIVER.SYS|n file is located, \DIR\ is the
  973. directory where that file is located, and here are the switches:
  974.  
  975. /D:### is the physical drive number that you want the logical drive to be
  976. a ghost twin to.  0 is for drive A:, 1 is for B:, 2 is for the next flop-
  977. py drive, etc.
  978.  
  979. /T:## is the number of tracks, on each side of the logical drive you're
  980.                            <page down> for more
  981.                          Logical Drives continued
  982. setting up.  For a 360K disk, that would be 40, and for a 720K, 1.2M,
  983. or 1.44M disk, that would be 80.  The default already is 80, so unless
  984. you're setting up a 360K logical drive, you can omit the /T:80 part.
  985.  
  986. /S:## is the number of sectors on each track of the logical drive you're
  987. setting up.  For a 360K or 720K disk, that would be 9.  For a 1.2M disk,
  988. 15, for a 1.44M disk, 18, or for a 2.88M disk, 36.  The |ndefault|n is 9, so
  989. if you're setting up a double density logical drive, you can omit this
  990. switch.
  991.  
  992. /F:# tells DOS what type of physical drive you're setting up the logical
  993. drive in.  Here are the choices:  0 for 360K, 1 for 1.2M, 2 for 720K, 7
  994. for 1.44M, and 9 for 2.88M.  The |ndefault|n is 2 so if you're setting up a
  995. logical drive in a 720K disk drive, you can leave out the /F:# switch.
  996.  
  997. So here's the command you would use to make a 720K logical drive twin
  998. for your 3.5" 1.44M A: drive:
  999.           DEVICE=C:\DOS\DRIVER.|nSYS|n /D:0 /F:7
  1000.                            <page down> for more
  1001.                          Logical Drives continued
  1002. For a 360K logical drive twin for your 5.25" 1.2M B: drive:
  1003.           DEVICE=C:\DOS\DRIVER.|nSYS|n /D:1 /T:40 /F:1
  1004. For a 1.2M logical drive twin for your 5.25" 1.2M B: drive:
  1005.           DEVICE=C:\DOS\DRIVER.|nSYS|n /D:1 /S:15 /F:1
  1006. Or for a 1.44M logical drive twin for your 3.5" 1.44M A: drive:
  1007.           DEVICE=C:\DOS\DRIVER.|nSYS|n /D:0 /S:18 /F:7
  1008. Of course all those examples assume that your DRIVER.SYS file is located
  1009. in the \DOS directory of your C: drive.
  1010.  
  1011. If this doesn't seem to work properly, try using the /F:# parameter for
  1012. the logical drive you're trying to set up, rather than using the one for
  1013. the physical drive you're trying to set it up in.  But be warned that it
  1014. is not a good idea to lie to the |nDRIVER.SYS|n |sdevice driver|s!
  1015.  
  1016.  
  1017.  
  1018.  
  1019.  
  1020.  
  1021.                             The |tCONFIG.SYS|t File
  1022.  
  1023. This is an ASCII text file that contains some special configuration com-
  1024. mands, which DOS reads each time you reboot your computer as long as the
  1025. file is located in the root directory of the disk you're booting from.
  1026. You can make any changes you want to this file but they won't take effect
  1027. until the next time you |nreboot|n.  Have a spare boo|1t disk handy first just
  1028. in case something doesn't work right, though.  Here are the commands that
  1029. can be used in the |nCONFIG.SYS|n file:
  1030.     BREAK   COUNTRY DEVICEHIGH DRIVPARM FILES   LASTDRIVE SHELL  SWITCHAR
  1031.     BUFFERS DEVIC|1E  DO|1S        FCBS     INSTALL REM       STACKS SWITCHES
  1032. |nBREAK|n and |nREM|n can also be used as regular DOS commands, but the others
  1033. can't be used anywhere except in the |nCONFIG.SYS|n file, and no other com-
  1034. mands besides these can be used in this file.  Any number of |nDRIVPARM|n,
  1035. |nINSTALL|n, |nREM|n, or DEVICE (or DEVICEHIGH) commands can be used, but the
  1036. others can only be used once in the file.  The DEVICE command is used
  1037. to activate device drivers.  RAMDRIVE.SYS, DRIVER.SYS, SMARTDRV.SYS,
  1038. and ANSI.SYS are a few examples of device drivers that come with DOS.
  1039. Each device driver can also be loaded only once, except |nDRIVER.SYS|n and
  1040. the RAMdisk drivers, which can be repeated.
  1041.                            The |TSWITCHES|T Command
  1042.  
  1043. This command was introduced with version 4 of DOS, and it can be used in
  1044. the CONFIG.SYS file to make DOS treat an extended 101-key keyboard like a
  1045. conventional 84-key |nkeyboard|n.  If you're running a program that doesn't
  1046. like your extended |nkeyboard|n, try the command SWITCHES=/K in your CONFIG
  1047. .|nSYS|n file and reboot.  Now DOS will totally ignore the scan codes passed
  1048. by those extra keys, and use the scan codes for their matching regular
  1049. keys instead, so they can't confuse your application or cause your system
  1050. to crash anymore.  What I mean by that is if you hit the <*> key over on
  1051. the numeric keypad, DOS will ignore that scan code and use the code for
  1052. the <*> key over on the regular part of the |nkeyboard|n.  If you use this
  1053. command and also install the ANSI.SYS device driver, use the /K switch
  1054. with ANSI also, as in:
  1055.           DEVICE=C:\DOS\ANSI.|nSYS|n /K
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061.                              The |TTYPE|T Command
  1062.  
  1063. This command is pretty much straightforward.  It just types a disk file
  1064. to the screen where you can look at it.  Or you can use it with output
  1065. redirection to send a copy of the file to your printer, or to a different
  1066. filename.
  1067.  
  1068. If the file is so long that it won't all fit on the screen at once, you
  1069. can stop the display from scrolling with the <Ctrl-S> keystroke combin-
  1070. ation, or the <Pause> key if you have one.  Or you can use the MORE fil-
  1071. ter with |nredirection|n, or you can just use the |nMORE|n command instead of the
  1072. |nTYPE|n command if you're really careful about using the < symbol instead of
  1073. the > symbol!
  1074.  
  1075. One big problem with the |nTYPE|n command is that if you use it on a file
  1076. that has a ^Z (End-of-File) character inside it, |nTYPE|n will think that's
  1077. the end of the file, and won't display another byte of it.  So if you
  1078. think that the file concatenation you just tried didn't work, it could be
  1079. that it worked just fine, only one of the first files in the concatena-
  1080.                            <page down> for more
  1081.                               TYPE continued
  1082. tion had a ^Z at the end of it, so the |nTYPE|n command won't display the
  1083. other files that you concatenated onto the end of that one.  They're
  1084. there, but you just can't see them with the |nTYPE|n command.  You can see
  1085. them, though, with the command |nCOPY|n /B FILENAME.EXT |nCON|n because the COPY
  1086. command with the /B switch will look in the file's directory entry and
  1087. see how many bytes long the file is, and copy all those |nbytes|n without
  1088. paying any attention to whether there are any ^Z characters in there.
  1089.  
  1090. Most .COM and .EXE files have ^Z (End-of-File) characters and ^G (Bell)
  1091. characters in them, so if you use the |nTYPE|n command on one of these, you
  1092. will hear a beep each time you reach a ^G character, and then the first
  1093. time you reach a ^Z character, the |nTYPE|n command will just stop and give
  1094. you back your DOS prompt.
  1095.  
  1096. Another use for the |nTYPE|n command is if you have a batch file where you'd
  1097. like to display a bunch of lines of messages to the screen all at once
  1098. from within that |nbatch file|n.  You could use a whole bunch of ECHO com-
  1099. mands, but that would be really slow since DOS reads each line of a batch
  1100.                            <page down> for more
  1101.                               TYPE continued
  1102. file from the disk, executes that command, reads the next line, etc.  A
  1103. faster way would be to make an ASCII file that contains just those mess-
  1104. ages that you want displayed, and perhaps name that file MESSAGES.TXT and
  1105. put it in your BELFRY directory (because that's where .BATs belong) and
  1106. then instead of putting all those ECHO commands into the batch file, just
  1107. put the command |nTYPE|n C:\BELFRY\MESSAGES.TXT in there instead.  But then
  1108. if you give a copy of that |nbatch file|n to a friend, don't forget to give
  1109. him the MESSAGES.TXT file too.
  1110.  
  1111. Anyway, the syntax for this command is just about as simple as it could
  1112. be, just the word |nTYPE|n followed by the filename and extension of the file
  1113. you want to display on your screen.  And of course if the file is not in
  1114. the current |ndirectory|n of the |ncurrent|n drive, then you tell DOS where it is
  1115. by including the entire |spath|sname for the file.  Some examples:
  1116.           |nTYPE|n |nCONFIG.SYS|n
  1117.           |nTYPE|n A:CONFIG.|nSYS|n
  1118.           |nTYPE|n C:\CONFIG.|nSYS|n
  1119.           |nTYPE|n C:\DOS\BAK\CONFIG.BAK
  1120.                            <page down> for more
  1121.                               TYPE continued
  1122. The worst thing about the |nTYPE|n command is that it only goes one way.  I
  1123. mean if you want to go back and look at an earlier part of the file that
  1124. has already scrolled off the screen, you have to BREAK out of the command
  1125. with the <Ctrl-C> keystroke combination, and use the <F3> key to repeat
  1126. the same |nTYPE|n command again, and start over from the beginning.  There
  1127. are lots of little public domain utilities such as BROWSE.COM, that you
  1128. can download from your local BBS, that let you use the <PageUp> and
  1129. <PageDn> keys to go to whatever part of the file you want to look at.
  1130.  
  1131.  
  1132.  
  1133.  
  1134.  
  1135.  
  1136.  
  1137.  
  1138.  
  1139.  
  1140.  
  1141.                            The |TSWITCHAR|T Command
  1142.  
  1143. This command only existed in DOS versions 2.0 and 2.1, and it could be
  1144. used in the CONFIG.SYS file to tell DOS what character you want to use
  1145. for switch parameters.  For example, if you used the UNIX operating sys-
  1146. tem a lot, that system uses a - for a switch character.  Then when you
  1147. use DOS you would have to get used to using / instead.  Well if you put
  1148. the command SWITCHAR=- into your |nCONFIG.SYS|n file, then you could say |nDIR|n
  1149. -P instead of |nDIR|n /P and it would be more like the UNIX system you were
  1150. used to.  If you don't have DOS version 2, then you can't use this com-
  1151. mand.  And if you aren't used to some other operating system besides DOS,
  1152. then you have no need for this command!
  1153.  
  1154.  
  1155.  
  1156.  
  1157.  
  1158.  
  1159.  
  1160.  
  1161.                              The |TPRINT|T Command
  1162.  
  1163. This command is used to send a copy of a file to your printer.  It's the
  1164. very oldest example of a multitasker under DOS, because it works in the
  1165. background to keep on printing your file, even after it has given you
  1166. back your DOS prompt and you have begun working on something else!
  1167.  
  1168. This is not the complete syntax of this command, but it's about the only
  1169. important parts.  Hardly anybody ever uses the other parts so I'm not
  1170. going to confuse you with them:
  1171.           |nPRINT|n /D:PORT /Q:## /C /T D:\DIR\FILENAME.EXT
  1172.  
  1173. The first time you use this command after the last time you |sreboot|sed, it
  1174. loads itself into memory as a TSR.  It also wants to know what port you
  1175. intend for it to print to.  It will ask you, and it will fill in the
  1176. blank with PRN.  If |nPRN|n is the port you want to use, then you just hit
  1177. <Enter>.  Otherwise, you type the name of port you do want to use, and
  1178. hit <Enter>.  If you want to avoid having |nPRINT|n ask you that question,
  1179. then you include the /D:PORT switch right on the command line with the
  1180.                            <page down> for more
  1181.                               PRINT continued
  1182. |nPRINT|n command, as in |nPRINT|n /D:LPT1 or |nPRINT|n /D:|nCOM2|n, or wherever your
  1183. printer is attached.  Now that's the port that the |nPRINT|n command is going
  1184. to use from then on, until you reboot the computer.  You can't use the
  1185. /D:PORT switch again to change it to something else.  If you want to
  1186. change it, you have to |nreboot|n and start the |nPRINT|n TSR over again.
  1187.  
  1188. Now the |nPRINT|n |nTSR|n is installed into memory, and the print queue is empty.
  1189. (The print queue is the internal list where the |nPRINT|n command stores the
  1190. names of the files that you've told it to print, that haven't been print-
  1191. ed yet.)  Or if you did put the filename on the command line when you
  1192. loaded the |nTSR|n into |nmemory|n, then that file goes right into the queue and
  1193. starts printing.  Now if you think of another file you'd like to print,
  1194. you just give another |nPRINT|n command with that second filename on the com-
  1195. mand line, and that file will be added to the queue (that's pronounced
  1196. just like the letter Q, by the way), and when the first file is done
  1197. printing, |nPRINT|n will look at the queue and print any files that are there
  1198. waiting to be printed.  The queue can hold up to ten filenames at a time.
  1199. If you need to be able to queue up more files than that at a time, you
  1200.                            <page down> for more
  1201.                               PRINT continued
  1202. can use the /Q:## switch on the command line, but only the first time you
  1203. issue the command.  If you've already loaded the |nPRINT|n TSR into memory,
  1204. then you have to reboot before you can issue a command like |nPRINT|n /Q:20
  1205. to enlarge the queue.  Any number up to 32 is allowed there.
  1206.  
  1207. If your printer dies or if the paper gets all jammed up, you can just say
  1208. |nPRINT|n /T and that terminates the printing and removes all the files from
  1209. the queue.  (However, it doesn't remove the |nPRINT|n |nTSR|n from |nmemory|n.)  Now
  1210. you can fix the printer or the paper, and start over.  Remember that your
  1211. printer contains a small buffer of |nmemory|n where it stores data that it's
  1212. about to print.  When you use |nPRINT|n /T to terminate printing, the printer
  1213. won't stop until it prints what's already in its own buffer, even though
  1214. |nPRINT|n immediately stops sending new data to the printer.
  1215.  
  1216. If you just decide there's one file that you had already put into the
  1217. print queue, that you don't want to print after all, you can remove it
  1218. from the print queue with the command |nPRINT|n /C D:\DIR\FILENAME.EXT which
  1219. will cancel that file from the queue.
  1220.                            <page down> for more
  1221.                               PRINT continued
  1222. You can also use wildcards with this command.  That means you could put
  1223. all the files that start with PB and have the extension .TXT into the
  1224. queue with just one |nPRINT|n PB*.TXT command.  The names of the files that
  1225. match that wildcard specification will be displayed on the screen, and if
  1226. you realize that you didn't mean to include a couple of those, you can
  1227. remove those from the queue with the /C switch.
  1228.  
  1229. And you can put more than one file into the queue at a time by typing
  1230. each filename on the command line, for example just one command:  |nPRINT|n
  1231. C:\DOS\README.TXT C:\DOS\APPNOTES.TXT would print those two files.
  1232.  
  1233. If you have DOS version 2, then you can't print files from any but the
  1234. current directory of any drive.  If you want to print a file from some
  1235. other |ndirectory|n, you have to use the CHDIR command to make that |ndirectory|n
  1236. |ncurrent|n, and then you can use the |nPRINT|n command to add that file to the
  1237. queue.
  1238.  
  1239. If you want to see what files are left in the queue at any time, just
  1240.                            <page down> for more
  1241.                               PRINT continued
  1242. issue the |nPRINT|n command with no parameters.
  1243.  
  1244. If you've ever heard the term "print spooler" and wondered what it meant,
  1245. the |nPRINT|n command is just a primitive example of a print spooler.  It
  1246. means a little TSR utility that keeps sending data to the printer while
  1247. you go ahead and use the computer for something else.
  1248.  
  1249. Just like the TYPE command, |nPRINT|n will ignore any data in a file that
  1250. occurs after the first ^Z character.
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261.                              The |TTREE|T Command
  1262.  
  1263. This command just shows you a sort of a list of all the directories and
  1264. subdirectories you have on your disk.  Here's the syntax:
  1265.           |nTREE|n D:\DIR /F /A
  1266. where D:\DIR is the drive and part of the directory tree where you want
  1267. to start the listing.  Before version 4, you couldn't say the |ndirectory|n,
  1268. just the drive, for which you want the tree display.  In version 4 if you
  1269. don't specify any pathname, it will start the display with the current
  1270. |ndirectory|n instead of the root the way older versions did.  The /F switch
  1271. says you want to see the names of all the files under each |ndirectory|n.
  1272. And the /A switch, starting with version 4, lets you use a slightly diff-
  1273. erent character set for the display, in case your printer doesn't like
  1274. the normal one.  That will make it use things like + and -- and || to draw
  1275. the lines with.  Of course to get the display to your printer, you use
  1276. output redirection, as in:
  1277.           |nTREE|n C:\ /F > |nPRN|n
  1278.  
  1279.  
  1280.  
  1281.                             The |TSETVER|T Command
  1282.  
  1283. This command is new to DOS version 5, and it is used to lie to programs
  1284. about what DOS version you are running.  You see, many programs, as you
  1285. load them, the first thing they do is ask the operating system what ver-
  1286. sion it is.  Well, programs that were written to accept an answer of any-
  1287. thing higher than X will run just fine under DOS 5.  But some silly pro-
  1288. grammers told their program to accept an answer of version X through ver-
  1289. sion Y instead.  And since a program like this was written before there
  1290. ever was a DOS version 5, it won't accept the answer of MS-DOS 5.00 at
  1291. all.  The program is going to say "Incorrect DOS version", and refuse to
  1292. load into memory.  Even if the program is perfectly compatible with ver-
  1293. sion 5, it won't run just because of a silly version number report.  Well
  1294. Microsoft thought of a neat little way to get around this problem.  First
  1295. call the publisher of the program that's giving you that "Incorrect DOS
  1296. version" error message, and ask them if the program is compatible with
  1297. DOS 5.  If they say ok, then you can use the |nSETVER|n command to tell the
  1298. program that 5 is an ok number for it to run under.  First you have to
  1299. have |nSETVER|n.EXE loaded into |nmemory|n as a device driver.  To do that, if it
  1300.                            <page down> for more
  1301.                              SETVER continued
  1302. hasn't already been done, just put this line into your CONFIG.SYS file:
  1303. DEVICE=C:\DOS\SETVER.EXE (or |sDEVICEHIGH|s) and just like any other change
  1304. you make to the |nCONFIG.SYS|n file, you have to reboot to make it take ef-
  1305. fect.  (And of course that sample command assumes that your |nSETVER.EXE|n
  1306. file is located in the DOS directory of your C: drive.)  Now, you just
  1307. issue a command like this:
  1308.           |nSETVER|n C:\DOS WP.EXE 3.3
  1309. That is assuming that your |nSETVER|n.EXE file is located in your C:\DOS dir-
  1310. ectory and that the name of the program that's giving you trouble is WP
  1311. .EXE and 3.3 is a DOS version under which that program used to run just
  1312. fine.  Now after you give that command, |nSETVER|n is going to display a
  1313. warning message about how Microsoft is not responsible for anything bad
  1314. that could happen if you use this command.  But you already called the
  1315. publisher of the WP.EXE program, right?  And they told you it was ok to
  1316. do this, so don't worry about that message.  Now, you just have to |nreboot|n
  1317. one more time to make this version number change thing take effect, and
  1318. from then on, whenever you try to load that program into memory, DOS will
  1319. lie to it and tell it that you're running DOS version 3.3, and the WP.EXE
  1320.                            <page down> for more
  1321.                              SETVER continued
  1322. program will be perfectly happy.
  1323.  
  1324. There are already some version-number lies automatically installed in the
  1325. |nSETVER|n.EXE program, the way it comes from Microsoft.  To see what those
  1326. are, just type |nSETVER|n C:\DOS <Enter>.  If you don't run any of those pro-
  1327. grams, you can remove their entries from the |nSETVER|n table, using the /D
  1328. switch of the |nSETVER|n command, like this:
  1329.           |nSETVER|n C:\DOS WP.EXE /D /QUIET
  1330. The /DELETE or /D switch tells DOS to remove that particular entry from
  1331. the |nSETVER|n version table, and the /QUIET switch tells DOS to suppress the
  1332. display of the message that it usually displays when removing an entry
  1333. from the table.  Removing unneeded entries from the table will cause the
  1334. version table to take up a little bit less memory next time you reboot.
  1335.  
  1336. Later, if you want to change the version number that you told |nSETVER|n to
  1337. report to a particular program, just issue the same |nSETVER|n command again
  1338. with the different version number.  It won't waste any |nmemory|n by using up
  1339. another entry in the table or anything.  The new entry for that filename
  1340.                            <page down> for more
  1341.                              SETVER continued
  1342. will just replace the old one that's already in the table.
  1343.  
  1344. Now the |nSETVER|n command does make a permanent change to the version table
  1345. that it keeps inside itself.  So you only have to give the command once,
  1346. not every time you reboot or anything.  |nSETVER|n will keep on lying to that
  1347. program every time you execute the program, forever and ever, as long as
  1348. you keep the |nSETVER|n.EXE DEVIC|1E command line in your CONFIG.SYS file.
  1349.  
  1350. If you are not using any of the programs that already have pre-installed
  1351. lies in the version table, and you're not planning to get any of them,
  1352. and you have tried all your programs under the new DOS, and none of them
  1353. need the |nSETVER|n lies, then you don't need to leave the |nSETVER|n.EXE device
  1354. driver installed in your |nCONFIG.SYS|n file like the DOS 5.0 installation
  1355. program put it there.  All it's doing is wasting memory if you don't run
  1356. any applications that need it.
  1357.  
  1358.  
  1359.  
  1360.  
  1361.                             The |TQBASIC|T Command
  1362.  
  1363. This is DOS version 5.0's new version of the old GWBASIC command.  The
  1364. biggest difference is the look of the program, and that it has lots of
  1365. online help for you while you're running it.  To get help, use the <F1>
  1366. key.
  1367.  
  1368. To run a BASIC program straight from the command line, you type a command
  1369. like this:
  1370.           |nQBASIC|n /RUN C:\DOS\PROGRAM.BAS
  1371. If the last instruction in the PROGRAM.BAS file is SYSTEM, then when the
  1372. program is done, it will return to DOS instead of just sitting there in
  1373. the |nQBASIC|n |nenvironment|n.
  1374.  
  1375. If you have some old BASIC programs written in GW-BASIC, the REMLINE.BAS
  1376. program that comes with DOS 5.0 will help you convert them to the format
  1377. that |nQBASIC|n uses.
  1378.  
  1379. Read the section on the |nGWBASIC|n command for more information.
  1380.  
  1381.                              The |TSORT|T Command
  1382.  
  1383. This command sorts ASCII files into |nASCII|n order.  That's pretty close to
  1384. alphabetical order except that lowercase letters come after of all the
  1385. uppercase ones (...XYZabc...).  But they corrected that problem starting
  1386. with DOS version 3, so now |nSORT|n really does sort in alphabetical order.
  1387.  
  1388. Actually, |nSORT|n is a filter, so it takes standard input and sends standard
  1389. output.  If you just use |nSORT|n with no Input/Output redirection, your cur-
  1390. sor will just drop down a line and wait for you to enter some lines of
  1391. text for it to sort.  You type the stuff and then hit <F6> or <Ctrl-Z> to
  1392. tell DOS you're done, hit <Enter>, and |nSORT|n will sort the text you just
  1393. typed, by the first character in each line, and send the output to the
  1394. screen.  If the first character is the same in two different lines, then
  1395. |nSORT|n will sort those two lines by their second character.  If those two
  1396. characters are the same too, then the third character will be used as the
  1397. tie-breaker, etc.
  1398.  
  1399. But you can use the |nSORT|n filter with input |nredirection|n, output redirec-
  1400.                            <page down> for more
  1401.                               SORT continued
  1402. tion, piping, or any combination of those, to make it do just about any-
  1403. thing you want.
  1404.  
  1405. Here's the syntax for this command:
  1406.           |nSORT|n /R /+# < D:\DIR\FILE1.EXT > D:\DIR\FILE2.EXT
  1407. where /R makes it sort in reverse order, /+# makes it sort by the # char-
  1408. acter instead of by the first character of each line, and FILE1.EXT is
  1409. the file you want it to sort.  Just make sure that you use < and not >,
  1410. to make the file point toward the command.  Because if you accidentally
  1411. use > instead, for that part of the command, then the file you wanted to
  1412. sort gets erased instead.  Now if you want the output of the |nSORT|n command
  1413. to go, instead of to the screen, somewhere else like to the printer or to
  1414. a different file, then you use the > symbol with PRN for the printer, or
  1415. with a filename as in the example above.  Make sure that you don't use
  1416. the same filename for the > symbol as you used for the < symbol, because
  1417. once again, that would erase the contents of that file before it gets a
  1418. chance to get sorted.  And if you want to keep the FILE2 file instead of
  1419. the FILE1 file, then you can delete the FILE1 file after the command is
  1420.                            <page down> for more
  1421.                               SORT continued
  1422. done, but first look at it to make sure that the |nSORT|n was successful and
  1423. didn't lose any of the data in the file.  Then use the RENAME command to
  1424. give the target file the same name as what the source file had before you
  1425. deleted it.  That is, if you want it to have the same old name.
  1426.  
  1427. You can also use |nSORT|n as the target of a piping operation.  That means
  1428. you can sort the output of another command before displaying it on the
  1429. screen.  For example, |nDIR|n || |nSORT|n /+14 would cause a DIR command to send
  1430. its output to the |nSORT|n command instead of to the screen, and |nSORT|n would
  1431. sort the directory listing by the data in the fourteenth column which is
  1432. the file size, and then that sorted output would go to your screen.
  1433.  
  1434. The trouble with that is that the lines of the |nDIR|n command's output that
  1435. say things like "Volume in drive C is WHATEVER" and "However many |nbytes|n
  1436. free" would be included in that sorted output.  Yuk.  To get rid of that
  1437. problem, use the FIND filter to get rid of those lines.  Every line that
  1438. has to do with files and directories has a - character in it, in the date
  1439. column.  So |nDIR|n || |nFIND|n "-" || |nSORT|n /+14 || |nMORE|n would take a |ndirectory|n
  1440.                            <page down> for more
  1441.                               SORT continued
  1442. listing, remove the lines that don't contain -, sort the remaining lines
  1443. according to column 14, and display the output 23 lines at a time so you
  1444. can see it before it scrolls off the screen.  Notice that it would work
  1445. just as well to say |nDIR|n || |nSORT|n /+14 || |nFIND|n "-" || |nMORE|n but it would take
  1446. longer, because there would be more lines for |nSORT|n to sort.  Using the
  1447. FIND command first to filter out the lines you're not going to want any-
  1448. way, means there are fewer lines for |nSORT|n to deal with.  Since |nSORT|n is
  1449. pretty slow, as far as computer programs go, you want to use |nFIND|n first
  1450. if that will serve the purpose, whenever you're using both filters in the
  1451. same command.
  1452.  
  1453. The first column in a directory listing is, of course, the filename.  The
  1454. extension starts in column 10, the size in column 14, the date in column
  1455. 24, and the time in column 34.  Of course, if you have DOS version 5, you
  1456. don't need the |nSORT|n command to sort your DIR listings, but it's still a
  1457. useful command, for sure!
  1458.  
  1459. A few caveats:  |nSORT|n can't handle files larger than 63 kilo|sbytes|s in size.
  1460.                            <page down> for more
  1461.                               SORT continued
  1462. Each line in the file must have a carriage return (the <Enter> key) at
  1463. the end of it.  If there is a ^Z End-of-File character at the end of the
  1464. file, it will be moved to the beginning since it has a lower ASCII code
  1465. number than any letters, and with a ^Z as the first character of the new
  1466. sorted file, you won't be able to TYPE the file to the screen, or PRINT
  1467. it, or do hardly anything with it!  (That's one reason why I said to make
  1468. sure the |nSORT|n was successful before you delete the original file, if the
  1469. sorted one is the only one you plan to keep.)  Make sure your file does
  1470. not have a ^Z in it before you use the |nSORT|n command on it.  You can use
  1471. the COPY command with the /A and /B switches to remove a ^Z from a file.
  1472. For example, |nCOPY|n /A FILEB4 FILEAFTR /B, then |nRENAME|n FILEAFTR FILEB4 to
  1473. give it back its old name.  Of course if FILEB4 has a ^Z in it before the
  1474. end of the file, all the data that came after it will be lost.  Don't do
  1475. this unless the first ^Z in the file comes at the very end of the file.
  1476. Or else do it on a spare copy of the file first and check the results be-
  1477. fore you do it on the real copy.
  1478.  
  1479.  
  1480.  
  1481.                               What Is a |tTSR|t?
  1482.  
  1483. |nTSR|n stands for Terminate-and-Stay-Resident.  Another name for |nTSR|n is Mem-
  1484. ory-Resident-Program.  That means any program that you load into memory
  1485. once, and it stays there, at your beck and call, or just hanging around
  1486. in the background watching every move you make, until such time as you
  1487. reboot the computer.
  1488.  
  1489. DOS itself can be thought of as a |nTSR|n, except that TSRs are usually op-
  1490. tional, and DOS is not.  If you don't have DOS resident in |nmemory|n then
  1491. your computer ain't going nowhere!  Device drivers are also TSRs in a
  1492. way, but just a special type of |nTSR|n.
  1493.  
  1494. If you have a mouse or trackball, and you load its driver via AUTOEXEC-
  1495. .BAT rather than CONFIG.SYS, then it is not a device driver exactly but
  1496. it still is a |nTSR|n, most definitely.  It hangs around in the background
  1497. watching you, and whenever you move your mouse it springs into action and
  1498. moves the mouse pointer around on your screen.
  1499.  
  1500.                            <page down> for more
  1501.                                TSR continued
  1502. Automatic screen savers that blank your screen after a certain number of
  1503. minutes of keyboard inactivity are TSRs.  Anything you can "hotkey" into
  1504. with a little keystroke combination like <Ctrl-Esc> or <Alt-F1> is also a
  1505. |nTSR|n.  There are lots of little phone book and appointment scheduler TSRs.
  1506.  
  1507. And here are some of the TSRs that come free with DOS:  APPEND, DOSKEY,
  1508. DOSSHELL, FASTOPEN, GRAPHICS, MIRROR, MODE, PRINT, and SHARE.  Except for
  1509. |nDOSSHELL|n and |nMIRROR|n, once you execute those commands, the |nTSR|n stays in
  1510. memory until you reboot.  Some TSRs have commands that remove them from
  1511. |nmemory|n, but not most of the ones that come with DOS!  Although there is a
  1512. great public domain utility called Mark-and-Release (and some others that
  1513. work in the same manner) that you can use to make it possible to remove
  1514. just about any |nTSR|n from |nmemory|n without rebooting.
  1515.  
  1516. Of course it's not possible to remove one |nTSR|n if there has been any other
  1517. |nTSR|n loaded into |nmemory|n after it.  The only thing you can remove from mem-
  1518. ory is the most recent thing you put into |nmemory|n.  Strangely enough, this
  1519. includes |sbatch file|ss.  If you issue a command to remove a |nTSR|n from mem-
  1520.                            <page down> for more
  1521.                                TSR continued
  1522. ory from within a batch file, that |nTSR|n won't drop out of memory until the
  1523. |nbatch file|n ends.  Because although a |nbatch file|n isn't actually loaded in-
  1524. to |nmemory|n while it is executed, there is some batch-file-handling code,
  1525. that does take up a speck of |nmemory|n while the |nbatch file|n is running.  So
  1526. the |nbatch file|n that gives the command to unload the |nTSR|n might cause the
  1527. |nTSR|n to be disabled and not work anymore, but the |nmemory|n that the |nTSR|n was
  1528. using won't be freed up for other uses until that |nbatch file|n exits to the
  1529. DOS prompt.
  1530.  
  1531. You mustn't ever try to load or unload a |nTSR|n from within another program,
  1532. such as when you're shelling out from your word processor or something.
  1533. You have to exit to the primary command processor before you can do any
  1534. messing around with |nmemory|n allocations, or you'll probably lock up the
  1535. whole computer and be forced to reboot, losing whatever data you had en-
  1536. tered into your application since the last time you saved it to disk.
  1537.  
  1538. If you have DOS version 4 or later, you can use the MEM command with the
  1539. /P or /D or /C switch to find out what TSRs you have loaded.  Otherwise,
  1540.                            <page down> for more
  1541.                                TSR continued
  1542. look and see what kinds of commands you have in your AUTOEXEC.BAT file.
  1543. The DOS commands you can look up right here to see if they're TSRs, and
  1544. the non-DOS commands you'll have to check the documentation that came
  1545. with that program.  Now you know what TSRs get loaded from your AUTOEXEC
  1546. .BAT file, and then there could also be others that you've loaded since
  1547. your |nAUTOEXEC.BAT|n file was run at bootup.
  1548.  
  1549. There are lots of occasions when you need to absolutely and without a
  1550. doubt boot up without any TSRs whatsoever.  For example, when you're in-
  1551. stalling a new software package you just bought, or every time you are
  1552. about to run a disk optimizer to take care of all your fragmented files.
  1553. The easiest way to do that, is to |nreboot|n from a boo|1t disk that was for-
  1554. matted with the /S switch, and that doesn't have any |nAUTOEXEC.BAT|n or CON-
  1555. FIG.|nSYS|n files on it.  You can put those files on your |nboot|n disk, but only
  1556. if the CONFIG.SYS file doesn't contain anything except your hard disk's
  1557. device driver if your hard disk needs one, and only if the |nAUTOEXEC.BAT|n
  1558. file doesn't contain anything but PATH and PROMPT.  Now you have a |nboot|n
  1559. disk that is safe to use whenever you're going to defragment your hard
  1560.                            <page down> for more
  1561.                                TSR continued
  1562. drive or install some new software.  This is necessary because really bad
  1563. things can happen if you have any TSRs in memory while you perform such
  1564. operations.  Especially the disk optimizer.  It's going to move all your
  1565. files to different parts of the disk.  Well if there's anything in |nmemory|n
  1566. like a disk cache, or FASTOPEN, or anything that keeps track of where the
  1567. data is at on the disk, well, when the optimizer moves everything around,
  1568. then those TSRs are going to have the wrong info, and they are going to
  1569. trash your entire FAT.  To really be on the safe side, reboot the compu-
  1570. ter again the very second the optimizer finishes!  That will remove ev-
  1571. erything from |nmemory|n and let the TSRs read the changed information from
  1572. the disk again, in case you had forgotten to remove any of them.
  1573.  
  1574. TSRs work by trapping a certain interrupt.  For example, a pop-up sched-
  1575. uler might sit there waiting for you to press the <Alt-S> keystroke.  Now
  1576. if you have another |nTSR|n that grabs the interrupt for that keystroke also,
  1577. or if the application you're working on uses that keystroke, then you've
  1578. got a |nTSR|n conflict.  There are a whole lot of ways that one |nTSR|n can con-
  1579. flict with another, or with a program.  So whenever you start using a |nTSR|n
  1580.                            <page down> for more
  1581.                                TSR continued
  1582. that you've never used before, watch out for problems, and if any occur,
  1583. it's probably the fault of your new |nTSR|n.  There ain't no such thing as a
  1584. free lunch, ya know, so along with the convenience of pop-up schedulers
  1585. and other highly useful TSRs, you've got to expect some problems too.
  1586. Most TSRs work just fine all by themselves, but when you go using more
  1587. than one at a time, there could be trouble.  I've been lucky, and only
  1588. had problems with two or three TSRs in my life, but I know people who've
  1589. had major problems with lots of them.  It just depends on what sort of
  1590. system you have, what other TSRs you use, and what applications you run.
  1591. It also depends a lot on what order you have the different TSRs installed
  1592. in your AUTOEXEC.BAT file.  If TSR-A doesn't work right when it's loaded
  1593. before TSR-B, then switch those |nAUTOEXEC.BAT|n lines around to load TSR-A
  1594. after TSR-B instead, and it might work just fine, believe it or not!
  1595.  
  1596. Many TSRs (and a lot of games too) take over the system clock (|sCLOCK$|s) a
  1597. bit more strongly than they ought to, and end up ruining the time and/or
  1598. date that DOS thinks it is.  If you find that you have such a program,
  1599. you want to remember to reset the TIME every now and then, so that the
  1600.                            <page down> for more
  1601.                                TSR continued
  1602. time in your directory listings stays close to correct.  You can use a
  1603. batch file to help you remember to do that.
  1604.  
  1605. This looks like a good time to tell you the safe way to install a new
  1606. program, whether it be a |nTSR|n or not.  First, never install more than one
  1607. new program in a day.  Because if you do, and problems occur, you have no
  1608. idea which program went wrong.  Install one, test it for a day or so,
  1609. then install the next one.  And never install a program without a backup.
  1610.  
  1611. Before you install anything, reboot the computer with no TSRs loaded.
  1612. Using an |nINSTALL|n command with TSRs in memory can make the installation
  1613. program screw everything up.  Read the program's documentation, especial-
  1614. ly the installation and troubleshooting chapters, and any README.TXT type
  1615. files that came with the program.  README.TXT files are generally full of
  1616. information that the publishers didn't remember until after the manual
  1617. was printed, so you don't want to miss it!  Now run the program's |nINSTALL|n
  1618. command and try out the new program.  If it works ok, |nreboot|n your compu-
  1619. ter with your normal CONFIG.SYS and AUTOEXEC.BAT files, and test it some
  1620.                            <page down> for more
  1621.                                TSR continued
  1622. more.  If there are any problems, then "REM out" the device drivers and
  1623. TSRs from those startup files, and try again.  Remove the REM from one
  1624. line at a time, reboot, test the program again, remove the |nREM|n from an-
  1625. other line, |nreboot|n, test, etc., until you discover which device driver or
  1626. |nTSR|n is conflicting with your new program.  Try changing the order of the
  1627. command that loads that driver or |nTSR|n, try it again, etc.  If your new
  1628. program just absolutely will not run with that |nTSR|n or driver, then you
  1629. have to make up your mind which one you'd rather give up.
  1630.  
  1631. Now besides installing new software, and using a disk optimizer, other
  1632. times when it's very important to remove all your TSRs and |ndevice drivers|n
  1633. from memory, are when you're about to use any BACKUP or RESTORE program,
  1634. or anything like PC Tools's DISKFIX command, or anything that's going to
  1635. seriously do low-level work on your hard drive.  In DOS 5.0, the manual
  1636. even says that you must not use CHKDSK with its /F switch, with any TSRs
  1637. in |nmemory|n.  And of course another reason to boot without TSRs is to free
  1638. up as much RAM as possible for program use, like if you've been getting
  1639. "Out of memory" errors.  (See also LOADHIGH.)
  1640.  
  1641.                           |tCleaning|t Your Computer
  1642.  
  1643. Well, dusting the outside of the case is pretty obvious, but did you know
  1644. that you need to do the inside of the computer once in a while too?  Yep,
  1645. the inside can get pretty nasty, because the fan in the |npower|n supply has
  1646. got to draw lots of air in from the front of the computer, across the
  1647. components, and out the back, to keep everything cool in there.  You must
  1648. not ever do something like covering over the floppy drive openings, to
  1649. keep dirt out, because the computer desperately needs the air that goes
  1650. through there.  Well, if air goes in, that's right, dust and cat hair and
  1651. stuff goes in too.  Well when it starts to build up on the components, it
  1652. acts like insulation and keeps the air from cooling the components, and
  1653. you have a fried computer!  So depending on how dirty the computer's en-
  1654. vironment is, about every three months you need to open up the case and
  1655. vacuum in there.  Just be careful!  See the section about Power for de-
  1656. tails about how to work inside the computer's case.  And don't let the
  1657. vacuum attachment touch anything in there.  Just get it close enough to
  1658. suck up the dirt.  And while you've got the case open, go ahead and re-
  1659. seat all the cards and cables as described in that |nPower|n section.
  1660.                            <page down> for more
  1661.                             Cleaning continued
  1662. Now for the monitor screen.  Many monitors have a special coating that
  1663. protects them from damage.  Well, glass cleaners can dissolve that coat-
  1664. ing.  (I know, because I ruined mine that way.)  If you've already used
  1665. some glass cleaner on it before you found that out, then you've probably
  1666. got a really blotchy screen from places where the coating is gone, and
  1667. places where it's still there.  You may as well get that glass cleaner
  1668. back out and remove the rest of the coating.  That would be better than
  1669. leaving it all blotchy like that.  A tiny speck of liquid fabric softener
  1670. diluted with a bunch of water is a real good thing to clean your monitor
  1671. with, because that will help cut down on static electricity without dam-
  1672. aging that coating, if it's not already too late.
  1673.  
  1674. You should turn your keyboard upside-down and shake it, or even bump it
  1675. very gently against the desktop, every now and then to get rid of some of
  1676. the crumbs and dirt that are always getting in there.  Use some alcohol
  1677. on a cotton swab or cotton ball to get the grime off the keys.  If you've
  1678. got a key that's sticking real bad, pry off the cap and use some alcohol
  1679. on the inside of the cap.  If you've got a |nkeyboard|n that's so filthy it
  1680.                            <page down> for more
  1681.                             Cleaning continued
  1682. doesn't work at all anymore, and you intend to throw it away and buy a
  1683. new one, there's one last-ditch effort you can make to try and save it.
  1684. There are some keyboards that can handle being taken into the shower,
  1685. soaped up, rinsed off real well, and left to dry for a couple days.  Sure
  1686. it could ruin it completely, but you were planning to throw it away any-
  1687. how, right?  And if it happens to be one of those keyboards that don't
  1688. mind water then it's fixed and you don't have to buy a new one after all!
  1689.  
  1690. All right, how about floppy drives?  Yes, they need to be cleaned too,
  1691. with one of those disk drive head |ncleaning|n kits that you can find in most
  1692. any computer store.  It's just like a |nfloppy|n disk, only instead of having
  1693. a real disk inside it, there's a round piece of a sort of |ncleaning|n cloth
  1694. in there.  Well you put a couple drops of this |ncleaning|n fluid that comes
  1695. in the kit, onto the cloth thing, and stick it in the drive, and issue a
  1696. DIR command on that drive to make the heads try to access the disk.  That
  1697. rubs the heads against the |ncleaning|n cloth for about fifteen seconds and
  1698. then you'll get the famous "|sAbort, Retry, Fail, Ignore|s" message because
  1699. of course the heads can't find the data on that disk.  If it didn't last
  1700.                            <page down> for more
  1701.                             Cleaning continued
  1702. fifteen seconds, then hit R for Retry and do it again.  Then hit A for
  1703. Abort, and you have a clean floppy drive.  But you should only do it once
  1704. every six months, or whenever you're getting a lot of read errors, which-
  1705. ever comes first.  That little |ncleaning|n cloth is kind of abrasive and is
  1706. not really good for the drive.  The drive does need to be kept clean, but
  1707. you mustn't use those |ncleaning|n kits as often as the instructions tell
  1708. you.  Remember that the people who wrote those instructions just want to
  1709. sell you more kits, and since each kit is only good for a limited number
  1710. of cleanings, then if you use it more often, you'll have to buy a new one
  1711. sooner, and that's just what they want.  Then your disk drive gets ruined
  1712. sooner too, and they can sell you another one of those as well.  That
  1713. would make them real happy.  But that's not what you want to do, is it?
  1714.  
  1715. You don't have to worry about your hard disks getting dirty, because they
  1716. are very well sealed.  Nothing's going to get in there.
  1717.  
  1718.  
  1719.  
  1720.  
  1721.                              What is the |tFAT|t?
  1722.  
  1723. Well, it's only the single most important part of a disk.  |nFAT|n stands for
  1724. File Allocation Table.  You know how a book has a table of contents and
  1725. an index?  Well if your two-year-old nephew ripped the table of contents
  1726. and index out of a book, you would still be able to read the information
  1727. in the book.  You'd just have to page through it and look at the chapter
  1728. titles and stuff.  Well DOS isn't that smart.  If DOS can't look in the
  1729. index and see the page number it wants to turn to, it won't even consider
  1730. thinking about trying to find any information.  It just won't even try.
  1731.  
  1732. Well the root directory of a disk is like the table of contents of a
  1733. book.  It tells DOS what the first page number (cluster number) of each
  1734. chapter (file) is.  But the |nFAT|n is even more important than that.  Be-
  1735. cause files get fragmented.  That means one fragment of a file gets stuck
  1736. over here on the disk, and another part of the file gets put over there
  1737. on the disk.  It's not like a book, where all the pages of a chapter are
  1738. in the same place, one right after the other.  Well DOS needs to look in
  1739. the index (FAT) of the book (disk) to see where all the other references
  1740.                            <page down> for more
  1741.                                FAT continued
  1742. to that chapter (file) are at on the disk.
  1743.  
  1744. The directory entry for a particular file includes the cluster number for
  1745. the first cluster of that file.  Now the |nFAT|n entry for that cluster tells
  1746. the number of the next cluster of the file.  And the |nFAT|n entry for that
  1747. next cluster tells the number for the next cluster after that.  And even-
  1748. tually one of the |nFAT|n entries will be the one that contains a special
  1749. character that says it's the last cluster of that file.
  1750.  
  1751. Well that's just about all you really need to know about the |nFAT|n.  With-
  1752. out it, DOS won't even make an attempt to find your files on your disks.
  1753. The |nFAT|n is so important that DOS keeps two identical copies of it, just
  1754. to be on the safe side.
  1755.  
  1756.  
  1757.  
  1758.  
  1759.  
  1760.  
  1761.                The |tAbort, Retry, Fail, Ignore|t Error Message
  1762.  
  1763. Here's something you're going to see about a zillion times.  Practically
  1764. every time anything goes wrong with a disk read or write, DOS is going to
  1765. tell you a short explanation of the problem and then show you this mess-
  1766. age as well, so you can decide what you want to do about that problem.
  1767. Well if it's a problem you can do something about, like putting the right
  1768. disk back into the drive, or removing the write-protect from the disk, or
  1769. closing the door on the drive, then do it and press R for Retry, and ev-
  1770. erything will be fine.  If it's not that simple, press R anyway and see
  1771. what happens.  If the same message comes back again, try R again a couple
  1772. more times and if you're still getting the same message, then choose A
  1773. for Abort, but be aware that what that will do is cancel the entire pro-
  1774. gram that asked for the disk access.  So you might lose some data.  The
  1775. only time I can think of that you'll need the Fail option, is if you have
  1776. $P$G as your prompt, and you forget and take the disk out of the drive
  1777. before you switch back to the hard drive.  Don't ever use the Ignore op-
  1778. tion unless you know exactly what you're doing.  What that one will do,
  1779. is allow the program to continue, without making the read or write on the
  1780. disk.  So don't ever choose Ignore.
  1781.                                 The |tPROMPT|t
  1782.  
  1783. You know the |nprompt|n that appears on your screen whenever DOS wants to
  1784. know what you want to do next.  It looks like this:
  1785.           C>
  1786. Boring, isn't it?  But did you know that you can make the |nprompt|n say any-
  1787. thing you want it to say?  With the |nPROMPT|n variable in the |senvironment|s!
  1788. If you type this at the command line:
  1789.           |nPROMPT|n Hello
  1790. Then your |nprompt|n will be
  1791.           Hello
  1792. instead of the usual C>.  Notice that in most cases, you need to use the
  1793. SET command to set an |nenvironment|n variable, but for PATH and |nPROMPT|n, the
  1794. |nSET|n command is not required.  Also, on some systems, an equals (=) sign
  1795. is required between the word |nPROMPT|n and the rest of the statement.  So if
  1796. |nPROMPT|n Hello doesn't work on your system, use |nPROMPT|n=Hello instead.
  1797.  
  1798. There are many special symbols you can use to get special characters into
  1799. your |nprompt|n:
  1800.                            <page down> for more
  1801.                              PROMPT continued
  1802.          $$  a $ symbol              $_  a carriage return
  1803.          $b  a || symbol              $d  the |ncurrent|n date
  1804.          $e  an ESCape character     $g  a > symbol
  1805.          $h  a backspace character   $l  a < symbol
  1806.          $n  the |ncurrent|n drive       $q  a = symbol
  1807.          $p  the |ncurrent|n |ndirectory|n   $t  the |ncurrent|n time
  1808.          $v  the DOS version          $  (space + $)  a trailing blank
  1809.  
  1810. The most commonly used |nPROMPT|n metacharacters are $p$g.  This |nprompt|n shows
  1811. what your current directory is at all times.  For example if your |ncurrent|n
  1812. |ndirectory|n is C:\DOS, then your |nprompt|n will be C:\DOS>.  If you change to
  1813. the C:\UTIL |ndirectory|n, using the CHDIR command, then the |nprompt|n immedi-
  1814. ately changes to C:\UTIL>.  You almost always want to use this as part of
  1815. your |nprompt|n if you're using a hard disk, so you never forget where you
  1816. are.  The only problem with this |nprompt|n is that it causes DOS to look at
  1817. your disk after every command, to see what the |ncurrent|n |ndirectory|n is, so
  1818. that it can display the |ncurrent|n |ndirectory|n's name.  Well the reason this
  1819. can be considered as a problem, is that if you switch the |ncurrent|n drive
  1820.                            <page down> for more
  1821.                              PROMPT continued
  1822. to a floppy disk, using the A: or B: command, before you put a disk into
  1823. that drive, you'll get an "|sAbort, Retry, Fail, Ignore|s" message.  It also
  1824. really slows things down on a |nfloppy|n drive, because it takes DOS so much
  1825. longer to look at a |nfloppy|n disk than to look at a hard disk.
  1826.  
  1827. So whenever you're about to switch over to work on a |nfloppy|n disk for a
  1828. while, you might want to issue the |nPROMPT|n command all by itself, with no
  1829. parameters.  What that will do is to reset the |nprompt|n to the default (the
  1830. |nprompt|n that DOS would normally use unless you gave it some other |nPROMPT|n
  1831. command), which is just the equivalent of $n$g, which only shows the cur-
  1832. rent drive, instead of the current drive and directory.  That way, DOS
  1833. doesn't have to look at the disk after each command to read the |ncurrent|n
  1834. |ndirectory|n's name.
  1835.  
  1836. For more information on great things you can do with the |nPROMPT|n command,
  1837. see the section about ANSI.SYS.
  1838.  
  1839. One concern that comes up quite frequently, is that a body sometimes gets
  1840.                            <page down> for more
  1841.                              PROMPT continued
  1842. a double |nprompt|n on his screen after running a batch file.  By that I mean
  1843. that the |nprompt|n looks like this:
  1844.           C:\DOS>
  1845.           C:\DOS>_
  1846. There are four things that I can think of right off the bat, that can
  1847. cause this little annoyance.  First, most any |nbatch file|n that doesn't
  1848. have "|nECHO|n OFF" in it, will do that.  Second, a lot of people have the
  1849. mistaken impression that they have to turn ECHO back on at the end of a
  1850. |nbatch file|n.  Not true.  DOS turns |nECHO|n on at the end of every |nbatch file|n
  1851. whether the command is given or not.  The only thing an "|nECHO|n ON" line at
  1852. the end of a |nbatch file|n does, is to take an extra couple of milliseconds
  1853. to process the |nbatch file|n, and to cause that nasty double |nprompt|n display.
  1854. One other thing that can cause it, is having an extra carriage return
  1855. (the <Enter> key) after the last line of the batch.  And finally, if none
  1856. of these seems to be the problem, you can just use EDLIN to remove the
  1857. carriage return from the last command in the |nbatch file|n.  To do that,
  1858. just retype the line and hit the <F6> key before you hit the <Enter> key.
  1859. That'll do it.  But it's not a good idea.  You really want all your batch
  1860. files to end with a carriage return.  (Not more than one, though.)
  1861.                          PLEASE IGNORE THIS PAGE!
  1862. |TSET|T|fSIMPLY1|f
  1863. |TSHELL|T|fSIMPLY1|f
  1864. |tANSI.SYS|t|fSIMPLY1|f
  1865. |tAUTOEXEC.BAT|t|fSIMPLY1|f
  1866. |tBACKUP|t|fSIMPLY1|f
  1867. |tBBS|t|fSIMPLY1|f
  1868. |tCHDIR|t|fSIMPLY1|f
  1869. |tCHKDSK|t|fSIMPLY1|f
  1870. |tCache|t|fSIMPLY1|f
  1871. |tDISKCOPY|t|fSIMPLY1|f
  1872. |tDirectory|t|fSIMPLY1|f
  1873. |tEnvironment|t|fSIMPLY1|f
  1874. |tMemory|t|fSIMPLY1|f
  1875. |tbytes|t|fSIMPLY1|f
  1876. |tcurrent|t|fSIMPLY1|f
  1877. |tdefault|t|fSIMPLY1|f
  1878. |tfragmented|t|fSIMPLY1|f
  1879. |tmacros|t|fSIMPLY1|f
  1880. |tmultitasker|t|fSIMPLY1|f
  1881. |tpublic domain|t|fSIMPLY1|f
  1882. |troot|t|fSIMPLY1|f
  1883. |TFORMAT|T|fSIMPLY2|f
  1884. |TRAMDRIVE.SYS|T|fSIMPLY2|f
  1885. |TRESTORE|T|fSIMPLY2|f
  1886. |TSYS|T|fSIMPLY2|f
  1887. |tASCII|t|fSIMPLY2|f
  1888. |tBoo|1t Disk|t|fSIMPLY2|f
  1889. |tDisks|t|fSIMPLY2|f
  1890. |tEDLIN|t|fSIMPLY2|f
  1891. |tParameters|t|fSIMPLY2|f
  1892. |tPower|t|fSIMPLY2|f
  1893. |tRAMdisk|t|fSIMPLY2|f
  1894. |tShelling Out|t|fSIMPLY2|f
  1895. |tdisk full|t|fSIMPLY2|f
  1896. |tediting keys|t|fSIMPLY2|f
  1897. |tfloppy|t|fSIMPLY2|f
  1898. |TAPPEND|T|fSIMPLY3|f
  1899. |TASSIGN|T|fSIMPLY3|f
  1900. |TBREAK|T|fSIMPLY3|f
  1901. |TBUFFERS|T|fSIMPLY3|f
  1902. |TCLOCK$|T|fSIMPLY3|f
  1903. |TCON|T|fSIMPLY3|f
  1904. |TCOPY|T|fSIMPLY3|f
  1905. |TCOUNTRY|T|fSIMPLY3|f
  1906. |TCTTY|T|fSIMPLY3|f
  1907. |TDEBUG|T|fSIMPLY3|f
  1908. |TDEL|T|fSIMPLY3|f
  1909. |TDEVICEHIGH|T|fSIMPLY3|f
  1910. |TDEVIC|1E|T|fSIMPLY3|f
  1911. |TDIR|T|fSIMPLY3|f
  1912. |TDISKCOMP|T|fSIMPLY3|f
  1913. |TDO|1S|T|fSIMPLY3|f
  1914. |TERASE|T|fSIMPLY3|f
  1915. |TFOR|T|fSIMPLY3|f
  1916. |TNUL|T|fSIMPLY3|f
  1917. |TPRN|T|fSIMPLY3|f
  1918. |TTIME|T|fSIMPLY3|f
  1919. |tDevice|1s|t|fSIMPLY3|f
  1920. |tPATH|t|fSIMPLY3|f
  1921. |tconcatenation|t|fSIMPLY3|f
  1922. |TDOSKEY|T|fSIMPLY4|f
  1923. |TDRIVPARM|T|fSIMPLY4|f
  1924. |TECHO|T|fSIMPLY4|f
  1925. |TFASTOPEN|T|fSIMPLY4|f
  1926. |TFCBS|T|fSIMPLY4|f
  1927. |TFDISK|T|fSIMPLY4|f
  1928. |TFILES|T|fSIMPLY4|f
  1929. |TFIND|T|fSIMPLY4|f
  1930. |TGRAPHICS|T|fSIMPLY4|f
  1931. |TINSTALL|T|fSIMPLY4|f
  1932. |TLABEL|T|fSIMPLY4|f
  1933. |TLASTDRIVE|T|fSIMPLY4|f
  1934. |TMORE|T|fSIMPLY4|f
  1935. |tWrite-protect|t|fSIMPLY4|f
  1936. |TDOSSHELL|T|fSIMPLY5|f
  1937. |TGWBASIC|T|fSIMPLY5|f
  1938. |TJOIN|T|fSIMPLY5|f
  1939. |TMEM|T|fSIMPLY5|f
  1940. |TMIRROR|T|fSIMPLY5|f
  1941. |TMODE|T|fSIMPLY5|f
  1942. |TRECOVER|T|fSIMPLY5|f
  1943. |TREM|T|fSIMPLY5|f
  1944. |TRENAME|T|fSIMPLY5|f
  1945. |TSHARE|T|fSIMPLY5|f
  1946. |TSTACKS|T|fSIMPLY5|f
  1947. |TUNFORMAT|T|fSIMPLY5|f
  1948. |tBoot|t|fSIMPLY5|f
  1949. |tReboot|t|fSIMPLY5|f
  1950. |tWildcards|t|fSIMPLY5|f
  1951. |TSMARTDRV.SYS|T|fSIMPLY4|f
  1952. |tBatch File|t|fSIMPLY7|f
  1953. |tDevice Driver|t|fSIMPLY3|f
  1954. |TLOADHIGH|T|fSIMPLY4|f
  1955. |tRAM|t|fSIMPLY1|f
  1956. |tExecutable|t|fSIMPLY2|f
  1957.